@@ -985,6 +985,13 @@ def constant_fold_fp_binop : GICombineRule<
985985 [{ return Helper.matchConstantFoldFPBinOp(*${d}, ${matchinfo}); }]),
986986 (apply [{ Helper.replaceInstWithFConstant(*${d}, ${matchinfo}); }])>;
987987
988+
989+ def constant_fold_fma : GICombineRule<
990+ (defs root:$d, constantfp_matchinfo:$matchinfo),
991+ (match (wip_match_opcode G_FMAD, G_FMA):$d,
992+ [{ return Helper.matchConstantFoldFMA(*${d}, ${matchinfo}); }]),
993+ (apply [{ Helper.replaceInstWithFConstant(*${d}, ${matchinfo}); }])>;
994+
988995def constant_fold_cast_op : GICombineRule<
989996 (defs root:$d, apint_matchinfo:$matchinfo),
990997 (match (wip_match_opcode G_ZEXT, G_SEXT, G_ANYEXT):$d,
@@ -1253,7 +1260,8 @@ def all_combines : GICombineGroup<[trivial_combines, insert_vec_elt_combines,
12531260 const_combines, xor_of_and_with_same_reg, ptr_add_with_zero,
12541261 shift_immed_chain, shift_of_shifted_logic_chain, load_or_combine,
12551262 div_rem_to_divrem, funnel_shift_combines, commute_shift,
1256- form_bitfield_extract, constant_fold_binops, constant_fold_cast_op, fabs_fneg_fold,
1263+ form_bitfield_extract, constant_fold_binops, constant_fold_fma,
1264+ constant_fold_cast_op, fabs_fneg_fold,
12571265 intdiv_combines, mulh_combines, redundant_neg_operands,
12581266 and_or_disjoint_mask, fma_combines, fold_binop_into_select,
12591267 sub_add_reg, select_to_minmax, redundant_binop_in_equality,
0 commit comments