mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-28 09:31:03 +00:00
Immediately erase trivially useless copies.
There is no need for these instructions to stick around since they are known to be not dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157102 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bd6f44a3a2
commit
3662f0d492
@ -1070,15 +1070,17 @@ bool RegisterCoalescer::joinCopy(MachineInstr *CopyMI, bool &Again) {
|
||||
|
||||
// If they are already joined we continue.
|
||||
if (CP.getSrcReg() == CP.getDstReg()) {
|
||||
markAsJoined(CopyMI);
|
||||
DEBUG(dbgs() << "\tCopy already coalesced.\n");
|
||||
LIS->RemoveMachineInstrFromMaps(CopyMI);
|
||||
CopyMI->eraseFromParent();
|
||||
return false; // Not coalescable.
|
||||
}
|
||||
|
||||
// Eliminate undefs.
|
||||
if (!CP.isPhys() && eliminateUndefCopy(CopyMI, CP)) {
|
||||
markAsJoined(CopyMI);
|
||||
DEBUG(dbgs() << "\tEliminated copy of <undef> value.\n");
|
||||
LIS->RemoveMachineInstrFromMaps(CopyMI);
|
||||
CopyMI->eraseFromParent();
|
||||
return false; // Not coalescable.
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user