mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-31 09:11:13 +00:00
Constant propagation should remove the dead instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12917 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cc713a343e
commit
4647b7cd69
@ -67,6 +67,10 @@ bool ConstantPropagation::runOnFunction(Function &F) {
|
||||
// Replace all of the uses of a variable with uses of the constant.
|
||||
I->replaceAllUsesWith(C);
|
||||
|
||||
// Remove the dead instruction.
|
||||
WorkList.erase(I);
|
||||
I->getParent()->getInstList().erase(I);
|
||||
|
||||
// We made a change to the function...
|
||||
Changed = true;
|
||||
++NumInstKilled;
|
||||
|
Loading…
Reference in New Issue
Block a user