[llvm] [AMDGPU] Fold constants in v2bf16 canonicalization (PR #214384)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 01:14:15 PDT 2026


================
@@ -1087,12 +1087,22 @@ define amdgpu_kernel void @s_test_canonicalize_undef_v2bf16(ptr addrspace(1) %ou
 }
 
 define <2 x bfloat> @v_test_canonicalize_reg_undef_v2bf16(bfloat %val) #1 {
-; GFX1250-LABEL: v_test_canonicalize_reg_undef_v2bf16:
-; GFX1250:       ; %bb.0:
-; GFX1250-NEXT:    s_wait_loadcnt_dscnt 0x0
-; GFX1250-NEXT:    s_wait_kmcnt 0x0
-; GFX1250-NEXT:    v_pk_mul_bf16 v0, 1.0, v0 op_sel_hi:[0,1]
-; GFX1250-NEXT:    s_set_pc_i64 s[30:31]
+; FAKE16-LABEL: v_test_canonicalize_reg_undef_v2bf16:
+; FAKE16:       ; %bb.0:
+; FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x0
+; FAKE16-NEXT:    s_wait_kmcnt 0x0
+; FAKE16-NEXT:    v_pk_mul_bf16 v0, 1.0, v0 op_sel_hi:[0,1]
+; FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)
+; FAKE16-NEXT:    v_perm_b32 v0, 0, v0, 0x5040100
+; FAKE16-NEXT:    s_set_pc_i64 s[30:31]
+;
+; REAL16-LABEL: v_test_canonicalize_reg_undef_v2bf16:
+; REAL16:       ; %bb.0:
+; REAL16-NEXT:    s_wait_loadcnt_dscnt 0x0
+; REAL16-NEXT:    s_wait_kmcnt 0x0
+; REAL16-NEXT:    v_pk_mul_bf16 v0, 1.0, v0 op_sel_hi:[0,1]
+; REAL16-NEXT:    v_mov_b16_e32 v0.h, 0
----------------
arsenm wrote:

Both of these results are worse 

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


More information about the llvm-commits mailing list