aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-03-06 21:08:33 +0000
committerDale Johannesen <dalej@apple.com>2009-03-06 21:08:33 +0000
commit3a56d146413ee344b10bbcb2b7d8dffaadc9fade (patch)
tree02d5cfe8988b26a733139702834d71fea9aaac3b
parent2ee7f8381f626c72c1cb1c744acb28b2974ea1b3 (diff)
downloadexternal_llvm-3a56d146413ee344b10bbcb2b7d8dffaadc9fade.zip
external_llvm-3a56d146413ee344b10bbcb2b7d8dffaadc9fade.tar.gz
external_llvm-3a56d146413ee344b10bbcb2b7d8dffaadc9fade.tar.bz2
Fix another case where debug info interferes with
an optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66288 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index 7c71f46..10b3104 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -385,7 +385,7 @@ static bool DominatesMergePoint(Value *V, BasicBlock *BB,
// only uses stuff defined outside of the condition. If so, hoist it out.
switch (I->getOpcode()) {
default: return false; // Cannot hoist this out safely.
- case Instruction::Load:
+ case Instruction::Load: {
// We can hoist loads that are non-volatile and obviously cannot trap.
if (cast<LoadInst>(I)->isVolatile())
return false;
@@ -397,9 +397,13 @@ static bool DominatesMergePoint(Value *V, BasicBlock *BB,
// Finally, we have to check to make sure there are no instructions
// before the load in its basic block, as we are going to hoist the loop
// out to its predecessor.
- if (PBB->begin() != BasicBlock::iterator(I))
+ BasicBlock::iterator IP = PBB->begin();
+ while (isa<DbgInfoIntrinsic>(IP))
+ IP++;
+ if (IP != BasicBlock::iterator(I))
return false;
break;
+ }
case Instruction::Add:
case Instruction::Sub:
case Instruction::And: