Make my earlier patch to skip debug intrinsics
when counting work; it was only off by 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65993 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 8f094b7..5b50ab5 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -11483,6 +11483,7 @@
BasicBlock::iterator BBI = &SI;
for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts;
--ScanInsts) {
+ --BBI;
// Don't count debug info directives, lest they affect codegen.
// Likewise, we skip bitcasts that feed into a llvm.dbg.declare; these are
// not present when debugging is off.
@@ -11490,10 +11491,8 @@
(isa<BitCastInst>(BBI) && BBI->hasOneUse() &&
isa<DbgDeclareInst>(BBI->use_begin()))) {
ScanInsts++;
- --BBI;
continue;
}
- --BBI;
if (StoreInst *PrevSI = dyn_cast<StoreInst>(BBI)) {
// Prev store isn't volatile, and stores to the same location?