[llvm-commits] [llvm] r45816 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Chris Lattner
sabre at nondot.org
Wed Jan 9 20:16:34 PST 2008
Author: lattner
Date: Wed Jan 9 22:16:31 2008
New Revision: 45816
URL: http://llvm.org/viewvc/llvm-project?rev=45816&view=rev
Log:
verify that the frame index is immutable before remat'ing (still disabled)
or being side-effect free.
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=45816&r1=45815&r2=45816&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Wed Jan 9 22:16:31 2008
@@ -749,10 +749,11 @@
// 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 @@
// 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;
}
More information about the llvm-commits
mailing list