Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use structs instead of pairs #719

Merged
merged 7 commits into from
Nov 6, 2023
Merged

use structs instead of pairs #719

merged 7 commits into from
Nov 6, 2023

Conversation

makslevental
Copy link
Contributor

@makslevental makslevental commented Nov 5, 2023

Let's use structs instead of pairs so that semantic info is preserved (and code is more readable).

Copy link
Collaborator

@jsetoain jsetoain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't finished with the review yet (it's a big one), but this is a fantastic refactor, long overdue. I wanted to give you a heads-up while I finish the review, I see you're changing a lot of signed integers to unsigned ones. The general preference is to use signed types unless there's a good reason not to.

include/aie/Dialect/AIE/IR/AIE.td Outdated Show resolved Hide resolved
include/aie/Dialect/AIE/IR/AIE.td Outdated Show resolved Hide resolved
@makslevental makslevental force-pushed the make_structs branch 3 times, most recently from f186a1d to 2ccf0ed Compare November 5, 2023 21:26
Copy link
Collaborator

@stephenneuendorffer stephenneuendorffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup!

@@ -232,24 +259,74 @@ template <> struct DenseMapInfo<xilinx::AIE::ObjectFifoAcquireOp> {
} // namespace llvm

namespace llvm {
using namespace xilinx::AIE;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 'using namespace' legit for headers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops

return std::tie(col, row) != std::tie(rhs.col, rhs.row);
}

inline bool operator<(const TileID &rhs) const {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably deserves a comment.

include/aie/Dialect/AIE/IR/AIE.td Outdated Show resolved Hide resolved
test/dialect/AIE/badconnect.mlir Outdated Show resolved Hide resolved
include/aie/Dialect/AIE/AIENetlistAnalysis.h Show resolved Hide resolved
Copy link
Collaborator

@AndraBisca AndraBisca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good and much needed cleanup! Thank you! :)

Copy link
Member

@keryell keryell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so much clearer!

Copy link
Collaborator

@jsetoain jsetoain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks again!

@makslevental
Copy link
Contributor Author

Outstanding TODOs:

  • remove using namespace in headers
  • fix I32Attrs
  • remove class NetlistAnalysis entirely

@makslevental makslevental merged commit 1a49ea1 into main Nov 6, 2023
6 checks passed
@makslevental makslevental deleted the make_structs branch November 7, 2023 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants