public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: apinski@marvell.com, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 7/7] Port most of the A CMP 0 ? A : -A to match
Date: Thu, 24 Jun 2021 09:08:07 -0600	[thread overview]
Message-ID: <1f0f5470-9b69-f783-f1f5-ea4ad82bd8a0@gmail.com> (raw)
In-Reply-To: <1624139345-6908-1-git-send-email-apinski@marvell.com>



On 6/19/2021 3:49 PM, apinski--- via Gcc-patches wrote:
> From: Andrew Pinski <apinski@marvell.com>
>
> To improve phiopt and be able to remove abs_replacement, this ports
> most of "A CMP 0 ? A : -A" from fold_cond_expr_with_comparison to
> match.pd.  There is a few extra changes that are needed to remove
> the "A CMP 0 ? A : -A" part from fold_cond_expr_with_comparison:
>     * Need to handle (A - B) case
>     * Need to handle UN* comparisons.
>
> I will handle those in a different patch.
>
> Note phi-opt-15.c test needed to be updated as we get ABSU now
> instead of not getting ABS.  When ABSU was added phiopt was not
> updated even to use ABSU instead of not creating ABS.
>
> OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
>
> gcc/ChangeLog:
>
> 	* match.pd (A CMP 0 ? A : -A): New patterns.
> 	* tree-ssa-phiopt.c (abs_replacement): Delete function.
> 	(tree_ssa_phiopt_worker): Don't call abs_replacement.
> 	Update comment about abs_replacement.
>
> gcc/testsuite/ChangeLog:
>
> 	* gcc.dg/tree-ssa/phi-opt-15.c: Update test to expect
> 	ABSU and still not expect ABS_EXPR.

> +(for cnd (cond vec_cond)
> + /* A == 0? A : -A    same as -A */
                        ^^
Missing whitespace.  This occurs in the comment each pattern.

OK with the nits fixed.

jeff


  reply	other threads:[~2021-06-24 15:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-19 21:49 apinski
2021-06-24 15:08 ` Jeff Law [this message]
2021-06-23 22:19 [PATCH 0/7] PHI-OPT move abs_replacement to match.pd apinski
2021-06-23 22:19 ` [PATCH 7/7] Port most of the A CMP 0 ? A : -A to match apinski
2021-06-24 15:19   ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f0f5470-9b69-f783-f1f5-ea4ad82bd8a0@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=apinski@marvell.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).