This disables some match (not the simplify one) patterns
for non-GIMPLE. All of the saturation related match patterns,
the clz/popcount related match patterns that are used from forwardprop.
Also cond_expr_convert_p and bitwise_induction_p match patterns.

These are only used from outside of match and simplify and only the
gimple form so there is no reason to generate the GENERIC form of
this.

THis should speed up bootstrap slightly by not generating or compiling
them. This should (when compiled without LTO) also improve the overall
size of the built binaries too.

For GCC 17, I am thinking about moving the gimple only simplify and match
patterns to their own file as match.pd is getting too big to search for
patterns.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

        * match.pd: Disable a few match patterns for !GIMPLE.

Signed-off-by: Andrew Pinski <[email protected]>
---
 gcc/match.pd | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/match.pd b/gcc/match.pd
index bf410a75f5f..a52cef3e626 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -3273,6 +3273,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
        || POINTER_TYPE_P (itype))
       && wi::eq_p (wi::to_wide (int_cst), wi::max_value (itype))))))
 
+#if GIMPLE
 /* Saturation add for unsigned integer.  */
 (if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type))
  (match (usadd_overflow_mask @0 @1)
@@ -3814,6 +3815,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
      }
      (if (c2_is_max_p)))))
 )
+#endif
 
 /* The boundary condition for case 10: IMM = 1:
    SAT_U_SUB = X >= IMM ? (X - IMM) : 0.
@@ -11765,6 +11767,7 @@ and,
          (vec_perm @2 @5 { op0; })))))))))))
 
 
+#if GIMPLE
 /* Match count trailing zeroes for simplify_count_zeroes in forwprop.
    The canonical form is array[((x & -x) * C) >> SHIFT] where C is a magic
    constant which when multiplied by a power of 2 contains a unique value
@@ -11912,6 +11915,8 @@ and,
  (bit_not
   (nop_convert1? (bit_xor@0 (convert2? (lshift integer_onep@1 @2)) @3))))
 
+#endif
+
 /* n - (((n > C1) ? n : C1) & -C2) ->  n & C1 for unsigned case.
    n - (((n > C1) ? n : C1) & -C2) ->  (n <= C1) ? n : (n & C1) for signed 
case.  */
 (simplify
-- 
2.43.0

Reply via email to