Initialize the SP to 0 in the prologue of functions with the
amdgpu_cs_chain or amdgpu_cs_chain_preserve calling conventions, but
only if they need one (i.e. if they contain calls to amdgpu_gfx
functions or if they have stack objects).
Details
Details
- Reviewers
arsenm - Group Reviewers
Restricted Project - Commits
- rG39830fea284f: [AMDGPU][PEI] Set up SP for chain functions
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Can you add a test where this would need stack realignment? You should be able to bypass all of that stuff (I think we have a calling convention override for that already, you might set that somewhere else)
llvm/lib/Target/AMDGPU/SIFrameLowering.cpp | ||
---|---|---|
1094 | We should probably get rid of SP_REG, it's always just hardcoded anyway |
llvm/lib/Target/AMDGPU/SIFrameLowering.cpp | ||
---|---|---|
1092 | Should use requiresStackPointerReference? |
Comment Actions
Use requiresStackPointerReference. We still need to check hasStackObjects though, otherwise we end up using an uninitialized s32 for spills and allocas. Ideally we'd be able to use an immediate for those cases, but I haven't figured out how to do that yet, so I left a FIXME.
Should use requiresStackPointerReference?