[llvm] [AMDGPU] Fix moveToValue for copy to phys SGPR (PR #76715)
Pierre van Houtryve via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 2 05:38:58 PST 2024
================
@@ -4,19 +4,20 @@
define amdgpu_cs <2 x i32> @f() {
; CHECK-LABEL: f:
; CHECK: ; %bb.0: ; %bb
-; CHECK-NEXT: s_mov_b32 s0, 0
-; CHECK-NEXT: s_mov_b32 s1, s0
-; CHECK-NEXT: s_mov_b32 s2, s0
-; CHECK-NEXT: s_mov_b32 s3, s0
-; CHECK-NEXT: s_mov_b32 s4, s0
-; CHECK-NEXT: buffer_load_dwordx2 v[0:1], off, s[0:3], 0
-; CHECK-NEXT: s_mov_b32 s5, s0
-; CHECK-NEXT: v_mov_b32_e32 v2, s0
+; CHECK-NEXT: s_mov_b32 s4, 0
+; CHECK-NEXT: s_mov_b32 s5, s4
+; CHECK-NEXT: s_mov_b32 s6, s4
+; CHECK-NEXT: s_mov_b32 s7, s4
+; CHECK-NEXT: s_mov_b32 s0, s4
+; CHECK-NEXT: buffer_load_dwordx2 v[0:1], off, s[4:7], 0
+; CHECK-NEXT: s_mov_b32 s1, s4
; CHECK-NEXT: s_waitcnt vmcnt(0)
-; CHECK-NEXT: v_cmp_ne_u64_e32 vcc_lo, s[4:5], v[0:1]
-; CHECK-NEXT: v_mov_b32_e32 v0, 0
-; CHECK-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
-; CHECK-NEXT: buffer_store_dwordx2 v[1:2], off, s[0:3], 0
+; CHECK-NEXT: v_cmp_ne_u64_e32 vcc_lo, s[0:1], v[0:1]
+; CHECK-NEXT: v_mov_b32_e32 v1, s4
+; CHECK-NEXT: s_mov_b32 s1, 0
+; CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc_lo
+; CHECK-NEXT: v_readfirstlane_b32 s0, v0
----------------
Pierre-vh wrote:
This looks odd, not sure it actually works. `s0` isn't guaranteed to be `v0`, is it? What if the first active lane gets the `1` from `cndmask` ?
https://github.com/llvm/llvm-project/pull/76715
More information about the llvm-commits
mailing list