summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopRotation.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
index 08d557e983c..ebba18c44ee 100644
--- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud