mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Correctly update counters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12810 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0190fdba44
commit
17177601fb
@ -144,13 +144,16 @@ bool ADCE::dropReferencesOfDeadInstructionsInLiveBlock(BasicBlock *BB) {
|
||||
// #arguments != #predecessors, so we remove them now.
|
||||
//
|
||||
PN->replaceAllUsesWith(Constant::getNullValue(PN->getType()));
|
||||
|
||||
} else {
|
||||
if (isa<CallInst>(I))
|
||||
++NumCallRemoved;
|
||||
else
|
||||
++NumInstRemoved;
|
||||
|
||||
// Delete the instruction...
|
||||
I = BB->getInstList().erase(I);
|
||||
BB->getInstList().erase(I++);
|
||||
Changed = true;
|
||||
++NumInstRemoved;
|
||||
} else {
|
||||
++I;
|
||||
}
|
||||
} else {
|
||||
++I;
|
||||
@ -497,8 +500,11 @@ bool ADCE::doADCE() {
|
||||
for (BasicBlock::iterator II = BI->begin(); II != --BI->end(); )
|
||||
if (!LiveSet.count(II)) { // Is this instruction alive?
|
||||
// Nope... remove the instruction from it's basic block...
|
||||
if (isa<CallInst>(II))
|
||||
++NumCallRemoved;
|
||||
else
|
||||
++NumInstRemoved;
|
||||
II = BI->getInstList().erase(II);
|
||||
++NumInstRemoved;
|
||||
MadeChanges = true;
|
||||
} else {
|
||||
++II;
|
||||
|
Loading…
Reference in New Issue
Block a user