[llvm] [AMDGPU] Make `getAssumedAddrSpace` return AS1 for pointer kernel arguments (PR #137488)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon May 5 14:58:41 PDT 2025


================
@@ -166,48 +146,28 @@ define amdgpu_kernel void @llvm_amdgcn_is_shared(ptr %ptr) #0 {
 define amdgpu_kernel void @llvm_amdgcn_is_private(ptr %ptr) #0 {
 ; GFX8V4-LABEL: llvm_amdgcn_is_private:
 ; GFX8V4:       ; %bb.0:
-; GFX8V4-NEXT:    s_load_dword s0, s[6:7], 0x44
-; GFX8V4-NEXT:    s_load_dword s1, s[8:9], 0x4
-; GFX8V4-NEXT:    s_waitcnt lgkmcnt(0)
-; GFX8V4-NEXT:    s_cmp_eq_u32 s1, s0
-; GFX8V4-NEXT:    s_cselect_b64 s[0:1], -1, 0
-; GFX8V4-NEXT:    v_cndmask_b32_e64 v0, 0, 1, s[0:1]
+; GFX8V4-NEXT:    v_mov_b32_e32 v0, 0
----------------
arsenm wrote:

No, this should absolutely not be removed. This is about flat usage in a kernel, the argument is a test implementation detail to have the smallest IR possible.

I think we just shouldn't have this optimization in the backend. We should move the infer address spaces runs to be middle end only 

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


More information about the llvm-commits mailing list