mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
All remat'ed loads cannot be folded into two-address code. Not just argument loads. This change doesn't really have any impact on codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47557 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -789,7 +789,7 @@ bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI,
|
|||||||
/// folding is possible.
|
/// folding is possible.
|
||||||
bool LiveIntervals::canFoldMemoryOperand(MachineInstr *MI,
|
bool LiveIntervals::canFoldMemoryOperand(MachineInstr *MI,
|
||||||
SmallVector<unsigned, 2> &Ops,
|
SmallVector<unsigned, 2> &Ops,
|
||||||
bool ReMatLoadSS) const {
|
bool ReMatLoad) const {
|
||||||
// Filter the list of operand indexes that are to be folded. Abort if
|
// Filter the list of operand indexes that are to be folded. Abort if
|
||||||
// any operand will prevent folding.
|
// any operand will prevent folding.
|
||||||
unsigned MRInfo = 0;
|
unsigned MRInfo = 0;
|
||||||
@ -797,8 +797,8 @@ bool LiveIntervals::canFoldMemoryOperand(MachineInstr *MI,
|
|||||||
if (FilterFoldedOps(MI, Ops, MRInfo, FoldOps))
|
if (FilterFoldedOps(MI, Ops, MRInfo, FoldOps))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Can't fold a load from fixed stack slot into a two address instruction.
|
// Can't fold a remat'ed load into a two address instruction.
|
||||||
if (ReMatLoadSS && (MRInfo & VirtRegMap::isMod))
|
if (ReMatLoad && (MRInfo & VirtRegMap::isMod))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return tii_->canFoldMemoryOperand(MI, FoldOps);
|
return tii_->canFoldMemoryOperand(MI, FoldOps);
|
||||||
@ -951,7 +951,7 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
|
|||||||
goto RestartInstruction;
|
goto RestartInstruction;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CanFold = canFoldMemoryOperand(MI, Ops, DefIsReMat && isLoadSS);
|
CanFold = canFoldMemoryOperand(MI, Ops, DefIsReMat && isLoad);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
CanFold = false;
|
CanFold = false;
|
||||||
|
Reference in New Issue
Block a user