[llvm] [AMDGPU] Fix uniform parameter pass using vgpr (PR #178198)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 29 07:07:18 PST 2026
================
@@ -510,57 +512,112 @@ define void @void_func_v32i32_inreg(<32 x i32> inreg %arg0) #0 {
; GFX9-LABEL: void_func_v32i32_inreg:
; GFX9: ; %bb.0:
; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX9-NEXT: v_mov_b32_e32 v19, v1
-; GFX9-NEXT: v_mov_b32_e32 v18, v0
-; GFX9-NEXT: global_store_dwordx4 v[0:1], v[14:17], off
-; GFX9-NEXT: global_store_dwordx4 v[0:1], v[10:13], off
-; GFX9-NEXT: global_store_dwordx4 v[0:1], v[6:9], off
-; GFX9-NEXT: global_store_dwordx4 v[0:1], v[2:5], off
-; GFX9-NEXT: v_mov_b32_e32 v16, s28
-; GFX9-NEXT: v_mov_b32_e32 v17, s29
-; GFX9-NEXT: global_store_dwordx4 v[0:1], v[16:19], off
+; GFX9-NEXT: v_readfirstlane_b32 s4, v1
+; GFX9-NEXT: v_readfirstlane_b32 s5, v0
+; GFX9-NEXT: v_readfirstlane_b32 s8, v3
+; GFX9-NEXT: v_readfirstlane_b32 s9, v2
; GFX9-NEXT: v_mov_b32_e32 v0, s24
; GFX9-NEXT: v_mov_b32_e32 v1, s25
; GFX9-NEXT: v_mov_b32_e32 v2, s26
; GFX9-NEXT: v_mov_b32_e32 v3, s27
; GFX9-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
-; GFX9-NEXT: s_nop 0
+; GFX9-NEXT: v_readfirstlane_b32 s42, v17
; GFX9-NEXT: v_mov_b32_e32 v0, s20
; GFX9-NEXT: v_mov_b32_e32 v1, s21
; GFX9-NEXT: v_mov_b32_e32 v2, s22
; GFX9-NEXT: v_mov_b32_e32 v3, s23
+; GFX9-NEXT: v_readfirstlane_b32 s43, v16
+; GFX9-NEXT: v_readfirstlane_b32 s44, v15
+; GFX9-NEXT: v_readfirstlane_b32 s45, v14
; GFX9-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
-; GFX9-NEXT: s_nop 0
+; GFX9-NEXT: v_readfirstlane_b32 s14, v13
; GFX9-NEXT: v_mov_b32_e32 v0, s16
; GFX9-NEXT: v_mov_b32_e32 v1, s17
; GFX9-NEXT: v_mov_b32_e32 v2, s18
; GFX9-NEXT: v_mov_b32_e32 v3, s19
+; GFX9-NEXT: v_readfirstlane_b32 s15, v12
----------------
arsenm wrote:
Ideally cases like this wouldn't increase the instruction count so much, but that's a missing optimization
https://github.com/llvm/llvm-project/pull/178198
More information about the llvm-commits
mailing list