diff options
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopInterchange.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp index cab6acce771..a641afeda03 100644 --- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp +++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp @@ -1220,6 +1220,9 @@ void LoopInterchangeTransform::restructureLoops( BasicBlock *OuterHeader = NewOuter->getHeader(); BasicBlock *OuterLatch = NewOuter->getLoopLatch(); for (BasicBlock *BB : OrigInnerBBs) { + // Nothing will change for BBs in child loops. + if (LI->getLoopFor(BB) != NewOuter) + continue; // Remove the new outer loop header and latch from the new inner loop. if (BB == OuterHeader || BB == OuterLatch) NewInner->removeBlockFromLoop(BB); |

