https://gcc.gnu.org/g:1bc846fc9e95e87e0d534d3ce35660e0e7776b13
commit r16-5532-g1bc846fc9e95e87e0d534d3ce35660e0e7776b13 Author: Andrew Pinski <[email protected]> Date: Thu Nov 20 12:41:10 2025 -0800 match: Move two patterns to use fold_before_rtl_expansion_p instead of !canonicalize_math_p This moves 2 patterns, `1/x` and `(m1 CMP m2) * d` patterns to use `fold_before_rtl_expansion_p()` instead of `!canonicalize_math_p ()` it was before. These 2 were checking !canonicalize_math_p() before because there was no other predicate that was decent until fold_before_rtl_expansion_p was added. Bootstrappd and tested on x86_64-linux-gnu. gcc/ChangeLog: * match.pd (1/x): Use fold_before_rtl_expansion_p. (`(m1 CMP m2) * d`): Likewise. Signed-off-by: Andrew Pinski <[email protected]> Diff: --- gcc/match.pd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/match.pd b/gcc/match.pd index bc31d7cc3f6a..5618f7296376 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -607,7 +607,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) && (!flag_non_call_exceptions || tree_expr_nonzero_p (@1))) (if (TYPE_UNSIGNED (type)) (convert (eq:boolean_type_node @1 { build_one_cst (type); })) - (if (!canonicalize_math_p ()) + (if (fold_before_rtl_expansion_p ()) (with { tree utype = unsigned_type_for (type); } (cond (le (plus (convert:utype @1) { build_one_cst (utype); }) { build_int_cst (utype, 2); }) @@ -2682,7 +2682,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (convert (bit_and (bit_not @1) @0)))) /* (m1 CMP m2) * d -> (m1 CMP m2) ? d : 0 */ -(if (!canonicalize_math_p ()) +(if (fold_before_rtl_expansion_p ()) (for cmp (tcc_comparison) (simplify (mult:c (convert (cmp@0 @1 @2)) @3)
