Replace the usage of LoopList in LoopInterchange completely with LoopNest.
Due to this change, we no longer need to explicitly pass OuterLoop and InnerLoop to processLoop as in D96650.
Also, make interchangeNestedLoops a member function of LoopNest so that LoopNestAnalysis is preserved.
Details
- Reviewers
Whitney
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/Analysis/LoopNestAnalysis.h | ||
---|---|---|
153 | Agreed. But I also think having interchangeNestedLoops here is good in the sense that we can do the asserts below. | |
llvm/lib/Transforms/Scalar/LoopInterchange.cpp | ||
504 | Though unrelated to this patch, I think this makes the code a bit clearer since Interchanged is always true when we reach here, and the change seems too trivial for a separate patch. |
llvm/include/llvm/Analysis/LoopNestAnalysis.h | ||
---|---|---|
153 | Can we have a generic set function with a generic assert (guarded by expensive checks macro)? then we can have interchangeNestedLoops in interchange pass? | |
llvm/lib/Transforms/Scalar/LoopInterchange.cpp | ||
504 | I see it now, let's just keep it here. |
llvm/include/llvm/Analysis/LoopNestAnalysis.h | ||
---|---|---|
153 | OK. But I think having a separate patch for that is more appropriate because this patch is primarily about removing the usage of LoopList and synchronizing the API between legacy and new pass manager. |
llvm/include/llvm/Analysis/LoopNestAnalysis.h | ||
---|---|---|
153 | ok, can you please add a TODO comment? |
llvm/include/llvm/Analysis/LoopNestAnalysis.h | ||
---|---|---|
153 | Thanks! Added TODO. |
Thinking we should have a more generic set function, like setLoops?