aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-03-10 21:19:49 +0000
committerDale Johannesen <dalej@apple.com>2009-03-10 21:19:49 +0000
commitff278b11bf03c8e407ed52f2ac57e207ef315354 (patch)
tree6d22cdb102b0e398a04e8ff173622e612d9cdbff
parent41d88d2ac07d1ccbb3c0d1430d57102aada89390 (diff)
Removing a dead debug intrinsic shouldn't trigger
another instcombine pass if we weren't going to make one without debug info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66576 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 86048e6a15..2bf87c0045 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -12566,12 +12566,15 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
BasicBlock::iterator I = Term; --I;
DOUT << "IC: DCE: " << *I;
- ++NumDeadInst;
-
+ // A debug intrinsic shouldn't force another iteration if we weren't
+ // going to do one without it.
+ if (!isa<DbgInfoIntrinsic>(I)) {
+ ++NumDeadInst;
+ Changed = true;
+ }
if (!I->use_empty())
I->replaceAllUsesWith(UndefValue::get(I->getType()));
I->eraseFromParent();
- Changed = true;
}
}
}