From: Chris Lattner Date: Thu, 10 Jan 2008 04:16:31 +0000 (+0000) Subject: verify that the frame index is immutable before remat'ing (still disabled) X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8794390406608541ab43b8ff196874b2dd055cdb;hp=c95f075c43488234e44b1213dfd762ae0a7509ea;p=oota-llvm.git 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 --- diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index c7313288605..26ab7d2d0a4 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -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; }