diff options
author | Dale Johannesen <dalej@apple.com> | 2009-03-03 01:43:03 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-03-03 01:43:03 +0000 |
commit | acb51a3037dcdb5fe074e429f83c4da25aa68e83 (patch) | |
tree | a8acd96e8044063fe2d711fdc8228651ff3ab800 | |
parent | 1d62705847839c189cd23ba3c3c1663ece32a976 (diff) |
Don't count DebugInfo instructions in another limit
(lest they affect codegen).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65915 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index e0d3ac4d42..f3fb4fb7f4 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -11439,12 +11439,18 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { SI.getAlignment())) SI.setAlignment(KnownAlign); - // Do really simple DSE, to catch cases where there are several consequtive + // Do really simple DSE, to catch cases where there are several consecutive // stores to the same location, separated by a few arithmetic operations. This // situation often occurs with bitfield accesses. BasicBlock::iterator BBI = &SI; for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts; --ScanInsts) { + // Don't count debug info directives, lest they affect codegen. + if (isa<DbgInfoIntrinsic>(BBI)) { + ScanInsts++; + --BBI; + continue; + } --BBI; if (StoreInst *PrevSI = dyn_cast<StoreInst>(BBI)) { |