https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126991

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrea Pinski <[email protected]>:

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

commit r17-3612-gf77f607c42df40f8d408fb65e8300e7428c26cfa
Author: Andrea Pinski <[email protected]>
Date:   Sat Aug 22 13:13:10 2026 -0700

    genmatch: Don't emit the ssa name checks for cond^ [PR126991]

    I noticed while working on cleanuping on the match patterns
    for the widdening multiply that genmatch would generate code like:
    ```
                      tree _p0 = build2 (gimple_cond_code (_cond_1),
boolean_type_node, _cond_lhs_1, _cond_rhs_1);
                      switch (TREE_CODE (_p0))
                        {
                        case SSA_NAME:
    ```
    So there was no way SSA_NAME would match here. This happens
    due to having a match pattern like:
    ```
      (match (spaceship @0 @1)
        (cond^ (le @0 @1) (negate (convert? (op @0 @1))) integer_onep)))
    ```

    This disables the generation of the SSA_NAME checks while processing the
gcond
    case.
    This saves ~2.5% of the generated lines for gimple-match*.cc files
    (or slightly over 10k lines). So this should improve build time of gcc
    ever so slightly, especially as cond^ is being used more.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR middle-end/126991

    gcc/ChangeLog:

            * genmatch.cc (dt_node::gen_kids): New in_gcond argument.
            (dt_node::gen_kids_1): New in_gcond argument.
            Disable SSA_NAME generation when in_gcond is true.
            (dt_operand::gen): Pass false to gen_kids.
            (decision_tree::gen): Likewise.
            (write_predicate): Likewise.
            (dt_operand::gen_phi_on_cond): Pass true to gen_kids.

    Signed-off-by: Andrea Pinski <[email protected]>

Reply via email to