mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Implicit def instructions, e.g. X86::IMPLICIT_DEF_GR32, are always re-materializable and they should not be spilled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44960 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -613,8 +613,10 @@ bool LiveIntervals::isReMaterializable(const LiveInterval &li,
|
||||
return false;
|
||||
|
||||
isLoad = false;
|
||||
if (tii_->isTriviallyReMaterializable(MI)) {
|
||||
isLoad = MI->getInstrDescriptor()->Flags & M_LOAD_FLAG;
|
||||
const TargetInstrDescriptor *TID = MI->getInstrDescriptor();
|
||||
if ((TID->Flags & M_IMPLICIT_DEF_FLAG) ||
|
||||
tii_->isTriviallyReMaterializable(MI)) {
|
||||
isLoad = TID->Flags & M_LOAD_FLAG;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -677,6 +679,15 @@ bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI,
|
||||
bool isSS, int Slot, unsigned Reg) {
|
||||
unsigned MRInfo = 0;
|
||||
const TargetInstrDescriptor *TID = MI->getInstrDescriptor();
|
||||
// If it is an implicit def instruction, just delete it.
|
||||
if (TID->Flags & M_IMPLICIT_DEF_FLAG) {
|
||||
RemoveMachineInstrFromMaps(MI);
|
||||
vrm.RemoveMachineInstrFromMaps(MI);
|
||||
MI->eraseFromParent();
|
||||
++numFolds;
|
||||
return true;
|
||||
}
|
||||
|
||||
SmallVector<unsigned, 2> FoldOps;
|
||||
for (unsigned i = 0, e = Ops.size(); i != e; ++i) {
|
||||
unsigned OpIdx = Ops[i];
|
||||
@@ -852,7 +863,8 @@ rewriteInstructionForSpills(const LiveInterval &li, bool TrySplit,
|
||||
} else {
|
||||
CanFold = canFoldMemoryOperand(MI, Ops);
|
||||
}
|
||||
} else CanFold = false;
|
||||
} else
|
||||
CanFold = false;
|
||||
|
||||
// Create a new virtual register for the spill interval.
|
||||
bool CreatedNewVReg = false;
|
||||
|
Reference in New Issue
Block a user