summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-06-16 21:13:38 +0000
committerJim Grosbach <grosbach@apple.com>2010-06-16 21:13:38 +0000
commit08f55d02da2cd24f3b4297259ef6429b8bf1ef97 (patch)
treecd7fabc0bb7b399a4b5b3396f8f77670c5f4578f /lib
parentd7d4ce3c9b70b796bdb263ae06c86f369361cd32 (diff)
downloadllvm-08f55d02da2cd24f3b4297259ef6429b8bf1ef97.tar.gz
llvm-08f55d02da2cd24f3b4297259ef6429b8bf1ef97.tar.bz2
llvm-08f55d02da2cd24f3b4297259ef6429b8bf1ef97.tar.xz
A few more places where SCEVExpander bits need to skip over debug intrinsics
when iterating through instructions. Yet more work for rdar://7797940 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ScalarEvolutionExpander.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp
index 4f49bf17fb..b4b00b9500 100644
--- a/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -97,7 +97,7 @@ Value *SCEVExpander::InsertNoopCastOfTo(Value *V, const Type *Ty) {
BasicBlock::iterator It = I; ++It;
if (isa<InvokeInst>(I))
It = cast<InvokeInst>(I)->getNormalDest()->begin();
- while (isa<PHINode>(It)) ++It;
+ while (isa<PHINode>(It) || isa<DbgInfoIntrinsic>(It)) ++It;
if (It != BasicBlock::iterator(CI)) {
// Recreate the cast after the user.
// The old cast is left in place in case it is being used
@@ -115,7 +115,7 @@ Value *SCEVExpander::InsertNoopCastOfTo(Value *V, const Type *Ty) {
BasicBlock::iterator IP = I; ++IP;
if (InvokeInst *II = dyn_cast<InvokeInst>(I))
IP = II->getNormalDest()->begin();
- while (isa<PHINode>(IP)) ++IP;
+ while (isa<PHINode>(IP) || isa<DbgInfoIntrinsic>(IP)) ++IP;
Instruction *CI = CastInst::Create(Op, V, Ty, V->getName(), IP);
rememberInstruction(CI);
return CI;
@@ -1070,7 +1070,8 @@ Value *SCEVExpander::visitAddRecExpr(const SCEVAddRecExpr *S) {
BasicBlock::iterator SaveInsertPt = Builder.GetInsertPoint();
BasicBlock::iterator NewInsertPt =
llvm::next(BasicBlock::iterator(cast<Instruction>(V)));
- while (isa<PHINode>(NewInsertPt)) ++NewInsertPt;
+ while (isa<PHINode>(NewInsertPt) || isa<DbgInfoIntrinsic>(NewInsertPt))
+ ++NewInsertPt;
V = expandCodeFor(SE.getTruncateExpr(SE.getUnknown(V), Ty), 0,
NewInsertPt);
restoreInsertPoint(SaveInsertBB, SaveInsertPt);