mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Add a utility function for conservatively clearing kill flags, and make
use of it in MachineCSE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103726 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -112,6 +112,7 @@ bool MachineCSE::PerformTrivialCoalescing(MachineInstr *MI,
|
||||
DEBUG(dbgs() << "Coalescing: " << *DefMI);
|
||||
DEBUG(dbgs() << "*** to: " << *MI);
|
||||
MO.setReg(SrcReg);
|
||||
MRI->clearKillFlags(SrcReg);
|
||||
if (NewRC != SRC)
|
||||
MRI->setRegClass(SrcReg, NewRC);
|
||||
DefMI->eraseFromParent();
|
||||
@@ -365,8 +366,10 @@ bool MachineCSE::ProcessBlock(MachineBasicBlock *MBB) {
|
||||
|
||||
// Actually perform the elimination.
|
||||
if (DoCSE) {
|
||||
for (unsigned i = 0, e = CSEPairs.size(); i != e; ++i)
|
||||
for (unsigned i = 0, e = CSEPairs.size(); i != e; ++i) {
|
||||
MRI->replaceRegWith(CSEPairs[i].first, CSEPairs[i].second);
|
||||
MRI->clearKillFlags(CSEPairs[i].second);
|
||||
}
|
||||
MI->eraseFromParent();
|
||||
++NumCSEs;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user