Instead of a for loop for, we can just use tcc_comparison
directly.  This changes the output of genmatch slightly
but no functional changes are here.  This simplifies
the pattern to easier to understand really.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

        * match.pd (`CMP * a`): Use tcc_comparison directly.
        (`(type)CMP * a`): Likewise.

Signed-off-by: Andrea Pinski <[email protected]>
---
 gcc/match.pd | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/gcc/match.pd b/gcc/match.pd
index 0dc0abe454f..0e96727083f 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -3035,19 +3035,17 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 
 /* (m1 CMP m2) * d -> (m1 CMP m2) ? d : 0  */
 (if (fold_before_rtl_expansion_p ())
- (for cmp (tcc_comparison)
-  (simplify
-   (mult:c (convert (cmp@0 @1 @2)) @3)
-   (if (INTEGRAL_TYPE_P (type)
-       && INTEGRAL_TYPE_P (TREE_TYPE (@0)))
-     (cond @0 @3 { build_zero_cst (type); })))
+ (simplify
+  (mult:c (convert (tcc_comparison@0 @1 @2)) @3)
+  (if (INTEGRAL_TYPE_P (type)
+       && INTEGRAL_TYPE_P (TREE_TYPE (@0)))
+   (cond @0 @3 { build_zero_cst (type); })))
 /* (-(m1 CMP m2)) & d -> (m1 CMP m2) ? d : 0  */
-  (simplify
-   (bit_and:c (negate (convert (cmp@0 @1 @2))) @3)
-   (if (INTEGRAL_TYPE_P (type)
-       && INTEGRAL_TYPE_P (TREE_TYPE (@0)))
-     (cond @0 @3 { build_zero_cst (type); })))
- )
+ (simplify
+  (bit_and:c (negate (convert (tcc_comparison@0 @1 @2))) @3)
+  (if (INTEGRAL_TYPE_P (type)
+       && INTEGRAL_TYPE_P (TREE_TYPE (@0)))
+   (cond @0 @3 { build_zero_cst (type); })))
 )
 
 /* Canonicalize `(type) (a CMP b)` to `(a CMP b) ? (type) true : (type) false`
-- 
2.43.0

Reply via email to