[AMDGPU] Fix function calls with flat scratch
authorSebastian Neubauer <sebastian.neubauer@amd.com>
Thu, 27 May 2021 16:32:42 +0000 (18:32 +0200)
committerSebastian Neubauer <sebastian.neubauer@amd.com>
Fri, 28 May 2021 09:22:13 +0000 (11:22 +0200)
commit690f5b7a0128a210093e9b217932743ad35b5c5a
tree1c2c6a93957a388a52485dc1c59ac5249bf1b466
parent6133b60a27fe0b89a96d5e10f28b2d9fd68d668f
[AMDGPU] Fix function calls with flat scratch

When flat scratch is used, the stack pointer needs to be added when
writing arguments to the stack.
For buffer instructions, this is done in SelectMUBUFScratchOffen
and SelectMUBUFScratchOffset.

Move that to call argument lowering, like it is done in GlobalISel.

Differential Revision: https://reviews.llvm.org/D103166
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/test/CodeGen/AMDGPU/callee-special-input-vgprs-packed.ll
llvm/test/CodeGen/AMDGPU/callee-special-input-vgprs.ll
llvm/test/CodeGen/AMDGPU/gfx-callable-argument-types.ll
llvm/test/CodeGen/AMDGPU/non-entry-alloca.ll