mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +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:
@@ -67,6 +67,10 @@ bool ConstantPropagation::runOnFunction(Function &F) {
|
|||||||
// Replace all of the uses of a variable with uses of the constant.
|
// Replace all of the uses of a variable with uses of the constant.
|
||||||
I->replaceAllUsesWith(C);
|
I->replaceAllUsesWith(C);
|
||||||
|
|
||||||
|
// Remove the dead instruction.
|
||||||
|
WorkList.erase(I);
|
||||||
|
I->getParent()->getInstList().erase(I);
|
||||||
|
|
||||||
// We made a change to the function...
|
// We made a change to the function...
|
||||||
Changed = true;
|
Changed = true;
|
||||||
++NumInstKilled;
|
++NumInstKilled;
|
||||||
|
|||||||
Reference in New Issue
Block a user