[llvm] [DAG] Constant fold FMAD (PR #69324)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 06:48:57 PDT 2023


================
@@ -2619,39 +2619,20 @@ define i64 @v_test_udiv64_mulhi_fold(i64 %arg) {
 ; VI-LABEL: v_test_udiv64_mulhi_fold:
 ; VI:       ; %bb.0:
 ; VI-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; VI-NEXT:    v_mov_b32_e32 v2, 0x4f800000
-; VI-NEXT:    v_madak_f32 v2, 0, v2, 0x47c35000
-; VI-NEXT:    v_rcp_f32_e32 v2, v2
+; VI-NEXT:    v_mov_b32_e32 v4, 0xa7c5
+; VI-NEXT:    v_mul_u32_u24_e32 v3, 0x500, v4
+; VI-NEXT:    v_mul_hi_u32_u24_e32 v2, 0x500, v4
----------------
RKSimon wrote:

There is already computeKnownBits handling for MUL_U24/MUL_I24 - but it might not be handling the entire constant fold, it looks to be mainly setting the leading/trailing known bits.

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


More information about the llvm-commits mailing list