diff options
| author | Dale Johannesen <dalej@apple.com> | 2009-03-06 21:08:33 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2009-03-06 21:08:33 +0000 |
| commit | 6e447e08ee3332722f8371d631645ff30110802a (patch) | |
| tree | 54de772fbaf5440f850a8bcaee3be3335e254b75 /llvm/lib/Transforms/Utils | |
| parent | e03c6102cc85f9b338c3ba740bb36c4ea007db17 (diff) | |
| download | bcm5719-llvm-6e447e08ee3332722f8371d631645ff30110802a.tar.gz bcm5719-llvm-6e447e08ee3332722f8371d631645ff30110802a.zip | |
Fix another case where debug info interferes with
an optimization.
llvm-svn: 66288
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 7c71f46290b..10b3104d6b6 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/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: |

