summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-08-02 00:59:51 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-08-02 00:59:51 +0000
commitd1867c034514bb87880ae6ae73694d4ad1f92db2 (patch)
treeb7178878b105dabe67431c892fe7a69ea092662a /llvm/lib/Target
parentacc5e82b0e33a27ba64ccb4f88c81fe8709d4576 (diff)
downloadbcm5719-llvm-d1867c034514bb87880ae6ae73694d4ad1f92db2.tar.gz
bcm5719-llvm-d1867c034514bb87880ae6ae73694d4ad1f92db2.zip
AMDGPU: Don't place arguments in emergency stack slot
When finding the fixed offsets for function arguments, this needs to skip over the 4 bytes reserved for the emergency stack slot. llvm-svn: 309776
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AMDGPU/SIISelLowering.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index 1b69cbdfcad..1d88b5d78d7 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -1345,6 +1345,12 @@ SDValue SITargetLowering::LowerFormalArguments(
bool IsKernel = AMDGPU::isKernel(CallConv);
bool IsEntryFunc = AMDGPU::isEntryFunctionCC(CallConv);
+ if (!IsEntryFunc) {
+ // 4 bytes are reserved at offset 0 for the emergency stack slot. Skip over
+ // this when allocating argument fixed offsets.
+ CCInfo.AllocateStack(4, 4);
+ }
+
if (IsShader) {
processShaderInputArgs(Splits, CallConv, Ins, Skipped, FType, Info);
@@ -1818,7 +1824,9 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI,
// Stack pointer relative accesses are done by changing the offset SGPR. This
// is just the VGPR offset component.
- SDValue StackPtr = DAG.getConstant(0, DL, MVT::i32);
+
+ // The first 4 bytes are reserved for the callee's emergency stack slot.
+ SDValue StackPtr = DAG.getConstant(4, DL, MVT::i32);
SmallVector<SDValue, 8> MemOpChains;
MVT PtrVT = MVT::i32;
OpenPOWER on IntegriCloud