]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
match: Move two patterns to use fold_before_rtl_expansion_p instead of !canonicalize_...
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Thu, 20 Nov 2025 20:41:10 +0000 (12:41 -0800)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Sun, 23 Nov 2025 18:39:26 +0000 (10:39 -0800)
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 <andrew.pinski@oss.qualcomm.com>
gcc/match.pd

index bc31d7cc3f6a043cb850e03af376792a52c310d8..5618f72963761e398e73fac7fc889d7499ab41d0 100644 (file)
@@ -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)