diff options
author | Chris Lattner <sabre@nondot.org> | 2008-01-05 06:10:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-01-05 06:10:42 +0000 |
commit | e0f0c4aa020654e451afcf42603c2bef66bc615b (patch) | |
tree | 2e3ae4b06ab26fcafc9a29970f91bd4a44d1e217 /llvm/lib | |
parent | d4738ee8e14f544f4153c54cfb30581a2287e090 (diff) | |
download | bcm5719-llvm-e0f0c4aa020654e451afcf42603c2bef66bc615b.tar.gz bcm5719-llvm-e0f0c4aa020654e451afcf42603c2bef66bc615b.zip |
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.
llvm-svn: 45623
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 38188369145..ede88f28ffe 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -141,6 +141,18 @@ bool X86InstrInfo::isReallyTriviallyReMaterializable(MachineInstr *MI) const { MI->getOperand(2).getImm() == 1 && MI->getOperand(3).getReg() == 0) 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; } // 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(3).getReg() == 0) 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; } |