mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Don't completely eliminate identity copies that also modify super register liveness.
Turn them into noop KILL instructions instead. This lets the scavenger know when super-registers are killed and defined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128645 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8901e6ff3d
commit
280ea1a746
@ -309,12 +309,18 @@ void VirtRegMap::rewrite(SlotIndexes *Indexes) {
|
||||
|
||||
// Finally, remove any identity copies.
|
||||
if (MI->isIdentityCopy()) {
|
||||
DEBUG(dbgs() << "Deleting identity copy.\n");
|
||||
RemoveMachineInstrFromMaps(MI);
|
||||
if (Indexes)
|
||||
Indexes->removeMachineInstrFromMaps(MI);
|
||||
// It's safe to erase MI because MII has already been incremented.
|
||||
MI->eraseFromParent();
|
||||
if (MI->getNumOperands() == 2) {
|
||||
DEBUG(dbgs() << "Deleting identity copy.\n");
|
||||
RemoveMachineInstrFromMaps(MI);
|
||||
if (Indexes)
|
||||
Indexes->removeMachineInstrFromMaps(MI);
|
||||
// It's safe to erase MI because MII has already been incremented.
|
||||
MI->eraseFromParent();
|
||||
} else {
|
||||
// Transform identity copy to a KILL to deal with subregisters.
|
||||
MI->setDesc(TII->get(TargetOpcode::KILL));
|
||||
DEBUG(dbgs() << "Identity copy: " << *MI);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
; RUN: llc < %s -march=bfin -join-liveintervals=0 -verify-machineinstrs
|
||||
; RUN: llc < %s -march=bfin -join-liveintervals=0 -verify-machineinstrs -regalloc=greedy
|
||||
|
||||
; Provoke an error in LowerSubregsPass::LowerExtract where the live range of a
|
||||
; super-register is illegally extended.
|
||||
|
Loading…
x
Reference in New Issue
Block a user