diff options
author | Preston Gurd <preston.gurd@intel.com> | 2013-03-27 23:16:18 +0000 |
---|---|---|
committer | Preston Gurd <preston.gurd@intel.com> | 2013-03-27 23:16:18 +0000 |
commit | 1fd36e41e408307a4e7362cc9cd83aeb77ee71dd (patch) | |
tree | d3032eb577b61d11731bc84f5bb4eb5ebd740f08 /lib/Target/X86/X86InstrInfo.cpp | |
parent | c8d65364223a04b179958a50a4bf0f89b21dd7d2 (diff) | |
download | llvm-1fd36e41e408307a4e7362cc9cd83aeb77ee71dd.tar.gz llvm-1fd36e41e408307a4e7362cc9cd83aeb77ee71dd.tar.bz2 llvm-1fd36e41e408307a4e7362cc9cd83aeb77ee71dd.tar.xz |
This patch follows is a follow up to r178171, which uses the register
form of call in preference to memory indirect on Atom.
In this case, the patch applies the optimization to the code for reloading
spilled registers.
The patch also includes changes to sibcall.ll and movgs.ll, which were
failing on the Atom buildbot after the first patch was applied.
This patch by Sriram Murali.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86InstrInfo.cpp')
-rw-r--r-- | lib/Target/X86/X86InstrInfo.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index 17714acd86..7ba542c875 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -3655,7 +3655,16 @@ X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF, const SmallVectorImpl<MachineOperand> &MOs, unsigned Size, unsigned Align) const { const DenseMap<unsigned, std::pair<unsigned,unsigned> > *OpcodeTablePtr = 0; + bool isCallRegIndirect = TM.getSubtarget<X86Subtarget>().callRegIndirect(); bool isTwoAddrFold = false; + + // Atom favors register form of call. So, we do not fold loads into calls + // when X86Subtarget is Atom. + if (isCallRegIndirect && + (MI->getOpcode() == X86::CALL32r || MI->getOpcode() == X86::CALL64r)) { + return NULL; + } + unsigned NumOps = MI->getDesc().getNumOperands(); bool isTwoAddr = NumOps > 1 && MI->getDesc().getOperandConstraint(1, MCOI::TIED_TO) != -1; |