This does not change the output of genmatch (except for line numbers)
but it simplifies the pattern in match.pd for easier understanding.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

        * match.pd (maybe_cmp): Use tcc_comparison directly instead
        of for loop.

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

diff --git a/gcc/match.pd b/gcc/match.pd
index e59c11d5d13..0dc0abe454f 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -172,13 +172,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
  (if (tree_nop_conversion_p (type, TREE_TYPE (@0)))))
 (match (bit_xor_cst @0 @1)
  (bit_xor @0 uniform_integer_cst_p@1))
-(for cmp (tcc_comparison)
- (match (maybe_cmp @0)
-  (cmp@0 @1 @2))
- (match (maybe_cmp @0)
-  (convert (cmp@0 @1 @2))
-   (if (tree_nop_conversion_p (type, TREE_TYPE (@0)))))
-)
+(match (maybe_cmp @0)
+ (tcc_comparison@0 @1 @2))
+(match (maybe_cmp @0)
+ (convert (tcc_comparison@0 @1 @2))
+  (if (tree_nop_conversion_p (type, TREE_TYPE (@0)))))
+
 /* `a ^ b` is another form of `a != b` when the type
     is a 1bit precision integer.  */
 (match (maybe_cmp @0)
-- 
2.43.0

Reply via email to