[llvm] [AMDGPU] Update PromoteAlloca to handle GEPs with variable offset. (PR #122342)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 18:39:02 PST 2025


================
@@ -122,6 +122,34 @@ define amdgpu_vs void @promote_load_from_store_aggr() #0 {
   ret void
 }
 
+%Block4 = type { [2 x i32], i32 }
+ at block4 = external addrspace(1) global %Block4
+%gl_PV = type { <4 x i32>, i32, [1 x i32], [1 x i32] }
+ at pv1 = external addrspace(1) global %gl_PV
+
+; This should should not crash on variable offset that can be
+; optimized out (variable foo4 in the test)
+define amdgpu_vs void @promote_load_from_store_aggr_varoff() local_unnamed_addr {
----------------
arsenm wrote:

```suggestion
define amdgpu_vs void @promote_load_from_store_aggr_varoff() {
```

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


More information about the llvm-commits mailing list