mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
When we do the single-store optimization, delete both the store
and the alloca so they don't get reprocessed. This speeds up PR1432 from 2.20s to 2.17s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40812 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -290,9 +290,15 @@ void PromoteMem2Reg::run() {
|
|||||||
|
|
||||||
// Finally, after the scan, check to see if the store is all that is left.
|
// Finally, after the scan, check to see if the store is all that is left.
|
||||||
if (Info.UsingBlocks.empty()) {
|
if (Info.UsingBlocks.empty()) {
|
||||||
++NumSingleStore;
|
// Remove the (now dead) store and alloca.
|
||||||
|
Info.OnlyStore->eraseFromParent();
|
||||||
|
if (AST) AST->deleteValue(AI);
|
||||||
|
AI->eraseFromParent();
|
||||||
|
|
||||||
// The alloca has been processed, move on.
|
// The alloca has been processed, move on.
|
||||||
RemoveFromAllocasList(AllocaNum);
|
RemoveFromAllocasList(AllocaNum);
|
||||||
|
|
||||||
|
++NumSingleStore;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -728,7 +734,7 @@ PromoteLocallyUsedAllocas(BasicBlock *BB, const std::vector<AllocaInst*> &AIs) {
|
|||||||
if (AIt != CurValues.end()) {
|
if (AIt != CurValues.end()) {
|
||||||
// Store updates the "current value"...
|
// Store updates the "current value"...
|
||||||
AIt->second = SI->getOperand(0);
|
AIt->second = SI->getOperand(0);
|
||||||
BB->getInstList().erase(SI);
|
SI->eraseFromParent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user