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.
Details
Details
- Reviewers
rampitec arsenm - Commits
- rG690f5b7a0128: [AMDGPU] Fix function calls with flat scratch
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Yes, it seems like globalisel handles adding the stack pointer in the AMDGPUOutgoingArgHandler. The code that adds the stack pointer in AMDGPUInstructionSelector::selectMUBUFScratchOffset is never hit, I’ll remove it.
I changed the handling in SDAG to match the one in GlobalISel. The stack pointer is now added when lowering call arguments and not when selecting instructions.