aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopRotation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopRotation.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp
index 08d557e983..ebba18c44e 100644
--- a/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/lib/Transforms/Scalar/LoopRotation.cpp
@@ -256,9 +256,7 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
// nodes will be created for all getResults later.
BasicBlock::iterator InsertPoint;
if (InvokeInst *II = dyn_cast<InvokeInst>(In)) {
- InsertPoint = II->getNormalDest()->begin();
- while (isa<PHINode>(InsertPoint))
- ++InsertPoint;
+ InsertPoint = II->getNormalDest()->getFirstNonPHI();
} else {
InsertPoint = I; // call
++InsertPoint;