public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amacleod at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/55157] Missed VRP with != 0 and multiply
Date: Fri, 04 Nov 2022 13:40:41 +0000	[thread overview]
Message-ID: <bug-55157-4-6zHD3nuaCk@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55157-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to Aldy Hernandez from comment #4)

> 
> The patch below does this, but it does have a 3% penalty for VRP (though no
> penalty to overall compilation).  I'm inclined to pursue this route, since
> it makes nonzero mask optimization more pervasive across the board.
> 
> What do you think Andrew?
> 

1) Why wouldn't this be done in set_range_from_nonzero_bits()?  That call is
just above that spot in the code. Or is the name misleading and it does
something else?

2) That seems expensive.. we must be doing unnecessary work.  Maybe it would
speed up if we checked if either the ctz or clz would cause it to do anything
first.  Thus avoiding creating a couple of ranges and performing a union and
intersection in cases where neither the leading nor trailing bit is a zero?

3) It also seems to me that you then only need to add the zero/union iff the
trailing bit has zeros. ie, if the are no trailing zeros, then just set the lb
to 0, and calculate the UB based on the clz.

I should think that would speed things up a bit.

  parent reply	other threads:[~2022-11-04 13:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 21:51 [Bug tree-optimization/55157] New: Missing VRP pinskia at gcc dot gnu.org
2021-12-25 23:35 ` [Bug tree-optimization/55157] Missed VRP with != 0 and multiply pinskia at gcc dot gnu.org
2022-11-04 11:22 ` aldyh at gcc dot gnu.org
2022-11-04 11:39 ` aldyh at gcc dot gnu.org
2022-11-04 13:40 ` amacleod at redhat dot com [this message]
2022-11-04 15:44 ` aldyh at gcc dot gnu.org
2022-11-04 15:46 ` aldyh at gcc dot gnu.org
2022-11-04 19:45 ` aldyh at gcc dot gnu.org
2022-11-04 19:48 ` aldyh at gcc dot gnu.org
2022-11-04 20:03 ` aldyh at gcc dot gnu.org
2022-11-05  9:04 ` aldyh at gcc dot gnu.org
2022-11-07 19:59 ` cvs-commit at gcc dot gnu.org
2022-11-07 20:02 ` aldyh at gcc dot gnu.org
2022-11-08 18:26 ` pinskia at gcc dot gnu.org

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=bug-55157-4-6zHD3nuaCk@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).