summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-09-14 17:37:40 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-09-14 17:37:40 +0000
commitdefe37177166ffaf14553f402ad4a0ea5971aa53 (patch)
tree5d75a8fd3415bbd9aa9a0ff9bc927dc293910508 /llvm/lib/Target/AMDGPU/SIISelLowering.cpp
parent45761a6950f8212e716b00f0a00752543f16b36d (diff)
downloadbcm5719-llvm-defe37177166ffaf14553f402ad4a0ea5971aa53.tar.gz
bcm5719-llvm-defe37177166ffaf14553f402ad4a0ea5971aa53.zip
AMDGPU: Stop modifying SP in call sequences
Because the stack growth direction and addressing is done in the same direction, modifying SP at the beginning of the call sequence was incorrect. If we had a stack passed argument, we would end up skipping that number of bytes before pushing arguments, leaving unused/inconsistent space. The callee creates fixed stack objects in its frame, so the space necessary for these is already logically allocated in the callee, so we just let the callee increment SP if it really requires it. llvm-svn: 313279
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIISelLowering.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIISelLowering.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index a5c5ecc694e..99f7badde71 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -2153,7 +2153,7 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI,
// Adjust the stack pointer for the new arguments...
// These operations are automatically eliminated by the prolog/epilog pass
if (!IsSibCall) {
- Chain = DAG.getCALLSEQ_START(Chain, NumBytes, 0, DL);
+ Chain = DAG.getCALLSEQ_START(Chain, 0, 0, DL);
unsigned OffsetReg = Info->getScratchWaveOffsetReg();
@@ -2359,8 +2359,8 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI,
InFlag = Chain.getValue(1);
}
- uint64_t CalleePopBytes = 0;
- Chain = DAG.getCALLSEQ_END(Chain, DAG.getTargetConstant(NumBytes, DL, MVT::i32),
+ uint64_t CalleePopBytes = NumBytes;
+ Chain = DAG.getCALLSEQ_END(Chain, DAG.getTargetConstant(0, DL, MVT::i32),
DAG.getTargetConstant(CalleePopBytes, DL, MVT::i32),
InFlag, DL);
if (!Ins.empty())
OpenPOWER on IntegriCloud