mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Use MRI::isConstantPhysReg() to check remat feasibility.
Don't depend on LiveIntervals::hasInterval() to determine if a physreg is reserved and constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159013 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
35ac4b0c45
commit
834a9cdbb7
@ -82,12 +82,16 @@ bool LiveRangeEdit::allUsesAvailableAt(const MachineInstr *OrigMI,
|
||||
UseIdx = UseIdx.getRegSlot(true);
|
||||
for (unsigned i = 0, e = OrigMI->getNumOperands(); i != e; ++i) {
|
||||
const MachineOperand &MO = OrigMI->getOperand(i);
|
||||
if (!MO.isReg() || !MO.getReg() || MO.isDef())
|
||||
continue;
|
||||
// Reserved registers are OK.
|
||||
if (MO.isUndef() || !LIS.hasInterval(MO.getReg()))
|
||||
if (!MO.isReg() || !MO.getReg() || !MO.readsReg())
|
||||
continue;
|
||||
|
||||
// We can't remat physreg uses, unless it is a constant.
|
||||
if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) {
|
||||
if (MRI.isConstantPhysReg(MO.getReg(), VRM->getMachineFunction()))
|
||||
continue;
|
||||
return false;
|
||||
}
|
||||
|
||||
LiveInterval &li = LIS.getInterval(MO.getReg());
|
||||
const VNInfo *OVNI = li.getVNInfoAt(OrigIdx);
|
||||
if (!OVNI)
|
||||
|
Loading…
Reference in New Issue
Block a user