[llvm] [SDAG] Drop select -> fmax/min folding in SelectionDAGBuilder (PR #93575)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 11:05:38 PDT 2024


================
@@ -1051,7 +1054,10 @@ define amdgpu_kernel void @v_test_legacy_fmed3_r_i_i_f32(ptr addrspace(1) %out,
 ; GFX9-SDAG-NEXT:    global_load_dword v1, v0, s[2:3]
 ; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0)
 ; GFX9-SDAG-NEXT:    v_add_f32_e32 v1, 1.0, v1
-; GFX9-SDAG-NEXT:    v_med3_f32 v1, v1, 2.0, 4.0
+; GFX9-SDAG-NEXT:    v_cmp_lt_f32_e32 vcc, 2.0, v1
+; GFX9-SDAG-NEXT:    v_cndmask_b32_e32 v1, 2.0, v1, vcc
----------------
arsenm wrote:

This regression actually doesn't look good. I need to look at this, but running instcombine on the test first doesn't recover the v_med3_f32 

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


More information about the llvm-commits mailing list