https://gcc.gnu.org/g:bf53cf53af96a6d976bf7d154d4db2704a74abd4

commit r17-4488-gbf53cf53af96a6d976bf7d154d4db2704a74abd4
Author: Andrea Pinski <[email protected]>
Date:   Sat Sep 19 14:40:04 2026 -0700

    match: Don't use for loop for maybe_cmp
    
    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]>

Diff:
---
 gcc/match.pd | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/gcc/match.pd b/gcc/match.pd
index e59c11d5d131..0dc0abe454f6 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)

Reply via email to