summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorFlorian Hahn <florian.hahn@arm.com>2018-04-23 21:38:19 +0000
committerFlorian Hahn <florian.hahn@arm.com>2018-04-23 21:38:19 +0000
commit74418185601af7ada9e07c6acdb237ec35b4ca43 (patch)
treef4c79f0bdb4c4eb106015e1549886d60090df465 /llvm
parentf66221c6ecd88435c685dd7aa38af1ab34241125 (diff)
downloadbcm5719-llvm-74418185601af7ada9e07c6acdb237ec35b4ca43.tar.gz
bcm5719-llvm-74418185601af7ada9e07c6acdb237ec35b4ca43.zip
[LoopInterchange] Do not change LI for BBs in child loops.
If a loop with child loops becomes our new inner loop after interchanging, we only need to update LoopInfo for the blocks defined in the old outer loop. BBs in child loops will stay there. Reviewers: efriedma, karthikthecool, mcrosier Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D45970 llvm-svn: 330653
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopInterchange.cpp3
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);
OpenPOWER on IntegriCloud