Skip to content

Commit 703703a

Browse files
author
Dale Johannesen
committed
Removing a dead debug intrinsic shouldn't trigger
another instcombine pass if we weren't going to make one without debug info. llvm-svn: 66576
1 parent ee66cf2 commit 703703a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12566,12 +12566,15 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
1256612566
BasicBlock::iterator I = Term; --I;
1256712567

1256812568
DOUT << "IC: DCE: " << *I;
12569-
++NumDeadInst;
12570-
12569+
// A debug intrinsic shouldn't force another iteration if we weren't
12570+
// going to do one without it.
12571+
if (!isa<DbgInfoIntrinsic>(I)) {
12572+
++NumDeadInst;
12573+
Changed = true;
12574+
}
1257112575
if (!I->use_empty())
1257212576
I->replaceAllUsesWith(UndefValue::get(I->getType()));
1257312577
I->eraseFromParent();
12574-
Changed = true;
1257512578
}
1257612579
}
1257712580
}

0 commit comments

Comments
 (0)