@@ -1372,6 +1372,12 @@ def select_to_iminmax: GICombineRule<
13721372 [{ return Helper.matchSelectIMinMax(${root}, ${info}); }]),
13731373 (apply [{ Helper.applyBuildFnMO(${root}, ${info}); }])>;
13741374
1375+ def simplify_neg_minmax : GICombineRule<
1376+ (defs root:$root, build_fn_matchinfo:$matchinfo),
1377+ (match (wip_match_opcode G_SUB):$root,
1378+ [{ return Helper.matchSimplifyNegMinMax(*${root}, ${matchinfo}); }]),
1379+ (apply [{ Helper.applyBuildFn(*${root}, ${matchinfo}); }])>;
1380+
13751381def match_selects : GICombineRule<
13761382 (defs root:$root, build_fn_matchinfo:$matchinfo),
13771383 (match (wip_match_opcode G_SELECT):$root,
@@ -2008,7 +2014,7 @@ def all_combines : GICombineGroup<[integer_reassoc_combines, trivial_combines,
20082014 and_or_disjoint_mask, fma_combines, fold_binop_into_select,
20092015 sub_add_reg, select_to_minmax,
20102016 fsub_to_fneg, commute_constant_to_rhs, match_ands, match_ors,
2011- combine_concat_vector,
2017+ simplify_neg_minmax, combine_concat_vector,
20122018 sext_trunc, zext_trunc, prefer_sign_combines, shuffle_combines,
20132019 combine_use_vector_truncate, merge_combines, overflow_combines]>;
20142020
0 commit comments