diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2017-03-26 16:46:53 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2017-03-26 16:46:53 +0000 |
commit | b71bb80c2debeab7128ce9be440d6601260910cd (patch) | |
tree | b8c03609eb21529e81346653b2231085c645e6c2 /llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp | |
parent | 12801f1e0f2f505ecf0a172341a6eccb2f930b28 (diff) | |
download | bcm5719-llvm-b71bb80c2debeab7128ce9be440d6601260910cd.tar.gz bcm5719-llvm-b71bb80c2debeab7128ce9be440d6601260910cd.zip |
[LoopUnroll] Remap references in peeled iteration
References in cloned blocks must be remapped prior to dominator
calculation.
Differential Revision: https://reviews.llvm.org/D31281
llvm-svn: 298811
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp b/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp index ea3e37d9c59..73c14f5606b 100644 --- a/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp @@ -415,6 +415,11 @@ bool llvm::peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, cloneLoopBlocks(L, Iter, InsertTop, InsertBot, Exit, NewBlocks, LoopBlocks, VMap, LVMap, DT, LI); + + // Remap to use values from the current iteration instead of the + // previous one. + remapInstructionsInBlocks(NewBlocks, VMap); + if (DT) { // Latches of the cloned loops dominate over the loop exit, so idom of the // latter is the first cloned loop body, as original PreHeader dominates @@ -437,10 +442,6 @@ bool llvm::peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, F->getBasicBlockList().splice(InsertTop->getIterator(), F->getBasicBlockList(), NewBlocks[0]->getIterator(), F->end()); - - // Remap to use values from the current iteration instead of the - // previous one. - remapInstructionsInBlocks(NewBlocks, VMap); } // Now adjust the phi nodes in the loop header to get their initial values |