[llvm] [AMDGPU] Swap select operands to allow later v_cndmask shrinking into vop2 (PR #142354)

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 11:02:05 PDT 2025


================
@@ -87,10 +87,11 @@ define amdgpu_kernel void @v_round_f64(ptr addrspace(1) %out, ptr addrspace(1) %
 ; SI-NEXT:    v_not_b32_e32 v5, v5
 ; SI-NEXT:    v_not_b32_e32 v4, v4
 ; SI-NEXT:    v_and_b32_e32 v5, v3, v5
-; SI-NEXT:    v_and_b32_e32 v4, v2, v4
 ; SI-NEXT:    v_cmp_gt_i32_e32 vcc, 0, v6
+; SI-NEXT:    v_and_b32_e32 v4, v2, v4
 ; SI-NEXT:    v_cndmask_b32_e32 v5, v5, v7, vcc
-; SI-NEXT:    v_cndmask_b32_e64 v4, v4, 0, vcc
+; SI-NEXT:    v_cmp_lt_i32_e32 vcc, -1, v6
+; SI-NEXT:    v_cndmask_b32_e32 v4, 0, v4, vcc
----------------
nhaehnle wrote:

Do you understand why we get an extra instruction here?

It seems to only affect SI (gfx6)...

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


More information about the llvm-commits mailing list