summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <florian.hahn@arm.com>2017-01-10 23:43:35 +0000
committerFlorian Hahn <florian.hahn@arm.com>2017-01-10 23:43:35 +0000
commit4f9d6d56c078a07f5020c6cbe8c55100184c27ff (patch)
treec6e94054a5c6049b79a3c83893466b96f17f9089 /llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
parent7d81813d76ded4b84456f18f01b43424c7e6d57d (diff)
downloadbcm5719-llvm-4f9d6d56c078a07f5020c6cbe8c55100184c27ff.tar.gz
bcm5719-llvm-4f9d6d56c078a07f5020c6cbe8c55100184c27ff.zip
[loop-unroll] Properly populate LoopInfo for loops cloned in LoopUnrollRuntime.
Summary: This fixes Transforms/LoopUnroll/runtime-loop3.ll which failed with EXTENSIVE_DEBUG, because the cloned basic blocks were not added to the correct sub-loops in LoopUnrollRuntime.cpp. Reviewers: dexonsmith, mzolotukhin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28482 llvm-svn: 291619
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
index 5758a415f12..85da3ba899a 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
@@ -301,15 +301,17 @@ static void CloneLoopBlocks(Loop *L, Value *NewIter,
LI->addTopLevelLoop(NewLoop);
}
+ NewLoopsMap NewLoops;
+ NewLoops[L] = NewLoop;
// For each block in the original loop, create a new copy,
// and update the value map with the newly created values.
for (LoopBlocksDFS::RPOIterator BB = BlockBegin; BB != BlockEnd; ++BB) {
BasicBlock *NewBB = CloneBasicBlock(*BB, VMap, "." + suffix, F);
NewBlocks.push_back(NewBB);
- if (NewLoop)
- NewLoop->addBasicBlockToLoop(NewBB, *LI);
- else if (ParentLoop)
+ if (NewLoop) {
+ addClonedBlockToLoopInfo(*BB, NewBB, LI, NewLoops);
+ } else if (ParentLoop)
ParentLoop->addBasicBlockToLoop(NewBB, *LI);
VMap[*BB] = NewBB;
OpenPOWER on IntegriCloud