LoopInterchange relies on LoopInfo being up-to-date, so we should
preserve it after interchanging. This patch updates restructureLoops to
move the BBs of the interchanged loops to the right place.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Can you add verify-loop-info to all the LoopInterchange tests?
lib/Transforms/Scalar/LoopInterchange.cpp | ||
---|---|---|
1188 ↗ | (On Diff #141014) | changeLoopFor works correctly even if OuterLoopParent is null, so the "if" isn't necessary. |
1221 ↗ | (On Diff #141014) | This looks weird; you're removing the block from the outer loop, but it's still in the inner loop? |
Comment Actions
Thanks Eli! I added -verify-loop-info to all tests. I also renamed the parameters of restructureLoops to NewInner and NewOuter, which makes things slightly clearer, I hope.
lib/Transforms/Scalar/LoopInterchange.cpp | ||
---|---|---|
1221 ↗ | (On Diff #141014) | In this version, the variable OuterLoop refers to the original outer loop, which becomes the inner loop and InnerLoop refers to the loop that becomes the outer loop. I have renamed the variables to NewInner and NewOuter. Do you think it's clearer now? |
Comment Actions
LGTM
lib/Transforms/Scalar/LoopInterchange.cpp | ||
---|---|---|
1221 ↗ | (On Diff #141014) | Yes, that helps. |