[llvm] [AMDGPU] Restore SP correctly in functions with dynamic allocas (PR #122743)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 14 03:32:34 PST 2025
easyonaadit wrote:
> The epilogue sequence is effectively `sp += bp`, is this correct? The prologue sequence is also confusing. Usually, `fp` and `bp` have swapped meaning.
AMDGPU has a growing-up stack, all calculations are based on that.
The calculations are based on if there has been a dynamic allocation.
The prolog does: `sp += frameSize + alignment`
and the epilog un-does this.
If there has been a dynamic allocation, then sp is not at the location the epilog expects it at, so the calculations give incorrect restoration of sp.
This patch is just returning sp to the location at which the epilog expects it.
https://github.com/llvm/llvm-project/pull/122743
More information about the llvm-commits
mailing list