aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopPeel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopPeel.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopPeel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopPeel.cpp b/llvm/lib/Transforms/Utils/LoopPeel.cpp
index e1dc052..4d43c6a 100644
--- a/llvm/lib/Transforms/Utils/LoopPeel.cpp
+++ b/llvm/lib/Transforms/Utils/LoopPeel.cpp
@@ -922,7 +922,7 @@ static void cloneLoopBlocks(
// InsertTop, using the incoming value from the preheader for the original
// preheader (when skipping the main loop) and the incoming value from the
// latch for the latch (when continuing from the main loop).
- IRBuilder<> B(InsertTop->getTerminator());
+ IRBuilder<> B(InsertTop, InsertTop->getFirstNonPHIIt());
for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
PHINode *NewPHI = cast<PHINode>(VMap[&*I]);
PHINode *PN = B.CreatePHI(NewPHI->getType(), 2);