diff options
author | Dan Gohman <gohman@apple.com> | 2008-04-21 23:59:07 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-04-21 23:59:07 +0000 |
commit | 61a921344090457f9429e44c7906ea75ce97e020 (patch) | |
tree | 14e1e665a355f7ff167f531a2bb2d3155f3baa9e /lib/Target/X86/X86MachineFunctionInfo.h | |
parent | f1f12f91e804d77ed301d006a412c169966e8ac9 (diff) | |
download | external_llvm-61a921344090457f9429e44c7906ea75ce97e020.tar.gz external_llvm-61a921344090457f9429e44c7906ea75ce97e020.tar.bz2 external_llvm-61a921344090457f9429e44c7906ea75ce97e020.zip |
Implement an x86-64 ABI detail of passing structs by hidden first
argument. The x86-64 ABI requires the incoming value of %rdi to
be copied to %rax on exit from a function that is returning a
large C struct.
Also, add a README-X86-64 entry detailing the missed optimization
opportunity and proposing an alternative approach.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50075 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86MachineFunctionInfo.h')
-rw-r--r-- | lib/Target/X86/X86MachineFunctionInfo.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Target/X86/X86MachineFunctionInfo.h b/lib/Target/X86/X86MachineFunctionInfo.h index fcdeb0572c..b5c9cafeca 100644 --- a/lib/Target/X86/X86MachineFunctionInfo.h +++ b/lib/Target/X86/X86MachineFunctionInfo.h @@ -53,20 +53,27 @@ class X86MachineFunctionInfo : public MachineFunctionInfo { /// the returnaddr can be savely move to this area int TailCallReturnAddrDelta; + /// SRetReturnReg - Some subtargets require that sret lowering includes + /// returning the value of the returned struct in a register. This field + /// holds the virtual register into which the sret argument is passed. + unsigned SRetReturnReg; + public: X86MachineFunctionInfo() : ForceFramePointer(false), CalleeSavedFrameSize(0), BytesToPopOnReturn(0), DecorationStyle(None), ReturnAddrIndex(0), - TailCallReturnAddrDelta(0) {} + TailCallReturnAddrDelta(0), + SRetReturnReg(0) {} X86MachineFunctionInfo(MachineFunction &MF) : ForceFramePointer(false), CalleeSavedFrameSize(0), BytesToPopOnReturn(0), DecorationStyle(None), ReturnAddrIndex(0), - TailCallReturnAddrDelta(0) {} + TailCallReturnAddrDelta(0), + SRetReturnReg(0) {} bool getForceFramePointer() const { return ForceFramePointer;} void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; } @@ -85,6 +92,9 @@ public: int getTCReturnAddrDelta() const { return TailCallReturnAddrDelta; } void setTCReturnAddrDelta(int delta) {TailCallReturnAddrDelta = delta;} + + unsigned getSRetReturnReg() const { return SRetReturnReg; } + void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; } }; } // End llvm namespace |