mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-01 09:18:30 +00:00
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
This commit is contained in:
parent
41d88d2ac0
commit
ff278b11bf
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user