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

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 03:06:32 PST 2024


================
@@ -30,15 +30,14 @@ define amdgpu_kernel void @kernel_non_entry_block_static_alloca_uniformly_reache
 ; MUBUF-NEXT:    s_cmp_lg_u32 s9, 0
 ; MUBUF-NEXT:    s_cbranch_scc1 .LBB0_3
 ; MUBUF-NEXT:  ; %bb.2: ; %bb.1
-; MUBUF-NEXT:    s_add_i32 s6, s32, 0x1000
-; MUBUF-NEXT:    s_lshl_b32 s7, s10, 2
-; MUBUF-NEXT:    s_mov_b32 s32, s6
+; MUBUF-NEXT:    s_mov_b32 s6, s32
----------------
easyonaadit wrote:

There are 2 cases in the IR which can lead to this code being exercised: Non-entry block static sized allocas, or dynamically sized allocas (something of the type: `%obj = alloca i32, i32 %n`). This patch does not extend support for dynamically sized allocas. Any test cases which have been added for dynamically sized allocas will have no change in their behavior. If they were failing previously, they will still fail. 
Dynamic sized allocas are custom lowered to produce an exception: https://github.com/llvm/llvm-project/pull/119822/files#diff-e78d2fbd64648d787707fd3d4e7e5b5d2f00fb9c09972937718a11237933c597L4066
However any test cases for non-entry block, static sized allocas will be affected. This was the only test case which tested non-entry block allocas.

Supporting dynamically sized allocas is in the pipeline, and there will be more test changes with that. 

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


More information about the llvm-commits mailing list