mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
enable sinking and licm of loads from the argument area. I'd like to enable this
for remat, but can't due to an RA bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45623 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -141,6 +141,18 @@ bool X86InstrInfo::isReallyTriviallyReMaterializable(MachineInstr *MI) const {
|
|||||||
MI->getOperand(2).getImm() == 1 &&
|
MI->getOperand(2).getImm() == 1 &&
|
||||||
MI->getOperand(3).getReg() == 0)
|
MI->getOperand(3).getReg() == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// If this is a load from a fixed argument slot, we know the value is
|
||||||
|
// invariant across the whole function, because we don't redefine argument
|
||||||
|
// values.
|
||||||
|
#if 0
|
||||||
|
// FIXME: This is disabled due to a remat bug. rdar://5671644
|
||||||
|
MachineFunction *MF = MI->getParent()->getParent();
|
||||||
|
if (MI->getOperand(1).isFI() &&
|
||||||
|
MF->getFrameInfo()->isFixedObjectIndex(MI->getOperand(1).getIndex()))
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// All other instructions marked M_REMATERIALIZABLE are always trivially
|
// All other instructions marked M_REMATERIALIZABLE are always trivially
|
||||||
@@ -188,6 +200,15 @@ bool X86InstrInfo::isReallySideEffectFree(MachineInstr *MI) const {
|
|||||||
MI->getOperand(2).getImm() == 1 &&
|
MI->getOperand(2).getImm() == 1 &&
|
||||||
MI->getOperand(3).getReg() == 0)
|
MI->getOperand(3).getReg() == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// If this is a load from a fixed argument slot, we know the value is
|
||||||
|
// invariant across the whole function, because we don't redefine argument
|
||||||
|
// values.
|
||||||
|
MachineFunction *MF = MI->getParent()->getParent();
|
||||||
|
if (MI->getOperand(1).isFI() &&
|
||||||
|
MF->getFrameInfo()->isFixedObjectIndex(MI->getOperand(1).getIndex()))
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user