This also means we have to check if the latch is the exiting block now, as transform expects the latches to be the exiting blocks too.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Transforms/Scalar/LoopInterchange.cpp | ||
---|---|---|
764 ↗ | (On Diff #141015) | This is slightly more generous than getLoopLatchExitBlock; is it okay if the terminator of the exiting block is a switch or invoke? Or do we check that somewhere else? |
865 ↗ | (On Diff #141015) | Is it actually possible for OuterExit to be null here? |
Thank you very much for having a look Eli and sorry for the delay, I needed to find some time to investigate another failure in the test suite with this change. Together with D45970 and this patch, building the test-suite with LoopInterchange + LTO passes.
I've updated the code to make sure the exiting's block's terminator is a branch instruction.
lib/Transforms/Scalar/LoopInterchange.cpp | ||
---|---|---|
555 ↗ | (On Diff #143596) | What is this closing brace doing here? Also, the indentation looks weird. |
865 ↗ | (On Diff #141015) | processLoopList contains an identical check. And I think OuterLoop->getExitingBlock() == OuterLoop->getLoopLatch() && isa<BranchInst>(OuterLoop->getLoopLatch()->getTerminator()) implies the exit is unique. |
lib/Transforms/Scalar/LoopInterchange.cpp | ||
---|---|---|
555 ↗ | (On Diff #143596) | Argh, sorry about that. Should be fixed now |
865 ↗ | (On Diff #141015) | There's one check to ensure the outermost loop in a nest has a unique exit block in processLoopList. Ah yes, the check Latch == single exiting block & isa<BranchInst> should guarantee that we have a unique exit block, thanks! |