verify that the frame index is immutable before remat'ing (still disabled)

or being side-effect free.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45816 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-01-10 04:16:31 +00:00
parent c95f075c43
commit 8794390406

View File

@ -749,10 +749,11 @@ bool X86InstrInfo::isReallyTriviallyReMaterializable(MachineInstr *MI) const {
// 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;
if (MI->getOperand(1).isFI()) {
const MachineFrameInfo &MFI=*MI->getParent()->getParent()->getFrameInfo();
int Idx = MI->getOperand(1).getIndex();
return MFI.isFixedObjectIndex(Idx) && MFI.isImmutableObjectIndex(Idx);
}
#endif
return false;
@ -805,9 +806,11 @@ bool X86InstrInfo::isReallySideEffectFree(MachineInstr *MI) const {
// 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;
if (MI->getOperand(1).isFI()) {
const MachineFrameInfo &MFI = *MF->getFrameInfo();
int Idx = MI->getOperand(1).getIndex();
return MFI.isFixedObjectIndex(Idx) && MFI.isImmutableObjectIndex(Idx);
}
return false;
}