public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: luoxhu--- via Gcc-patches <gcc-patches@gcc.gnu.org>,
	luoxhu@linux.ibm.com,  wschmidt@linux.ibm.com, linkw@gcc.gnu.org,
	joseph@codesourcery.com, richard.sandiford@arm.com
Subject: Re: [PATCH] Fold (add -1; zero_ext; add +1) operations to zero_ext when not zero (PR37451, PR61837)
Date: Thu, 16 Apr 2020 20:21:40 -0500	[thread overview]
Message-ID: <20200417012140.GJ26902@gate.crashing.org> (raw)
In-Reply-To: <mptmu7dnm3r.fsf@arm.com>

On Wed, Apr 15, 2020 at 10:18:16AM +0100, Richard Sandiford wrote:
> luoxhu--- via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> > -    count = simplify_gen_binary (PLUS, mode, count, const1_rtx);
> > +    {
> > +      /* Fold (add -1; zero_ext; add +1) operations to zero_ext based on addop0
> > +	 is never zero, as gimple pass loop ch will do optimization to simplify
> > +	 the loop to NO loop for loop condition is false.  */
> 
> IMO the code needs to prove this, rather than just assume that previous
> passes have made it so.

Well, it should gcc_assert it, probably.

It is the left-hand side of a+b...  it cannot be 0, because niter always
is simplified!


Segher

  reply	other threads:[~2020-04-17  1:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15  8:47 luoxhu
2020-04-15  9:18 ` Richard Sandiford
2020-04-17  1:21   ` Segher Boessenkool [this message]
2020-04-17 16:32     ` Segher Boessenkool
2020-04-20  8:21       ` luoxhu
2020-04-20  9:05         ` luoxhu
2020-05-12  6:48           ` [PATCH v2] Fold (add -1; zero_ext; add +1) operations to zero_ext when not overflow (PR37451, part of PR61837) luoxhu
2020-05-12 14:58             ` Segher Boessenkool
2020-05-12 18:24             ` Richard Sandiford
2020-05-14  2:48               ` luoxhu
2020-05-14 11:15                 ` Richard Sandiford
2020-04-15  9:37 ` [PATCH] Fold (add -1; zero_ext; add +1) operations to zero_ext when not zero (PR37451, PR61837) Jakub Jelinek

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=20200417012140.GJ26902@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=linkw@gcc.gnu.org \
    --cc=luoxhu@linux.ibm.com \
    --cc=richard.sandiford@arm.com \
    --cc=wschmidt@linux.ibm.com \
    /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).