[llvm] [AMDGPU] Update base addr of dyn alloca considering GrowingUp stack (PR #119822)

Christudasan Devadasan via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 23:41:43 PST 2024


cdevadas wrote:

> > > AMDGPU stack grows upwards, the base address
> > > needs to be aligned first and SP bump by required size later:
> > 
> > 
> > The address computation should be retained for both directions. The Opc selection currently happens based on the Stack growth direction (as per the code below). The code would otherwise break suddenly if we decide to change the stack growth direction for any future architecture. **TFL->getStackGrowthDirection() == TargetFrameLowering::StackGrowsUp**
> 
> We won't decide to change the stack growth direction. We probably shouldn't be trying to handle grow down in any way

If that's the case why do we need this while selecting the opcode
https://github.com/llvm/llvm-project/pull/119822/files#diff-e78d2fbd64648d787707fd3d4e7e5b5d2f00fb9c09972937718a11237933c597R4042

https://github.com/llvm/llvm-project/pull/119822


More information about the llvm-commits mailing list