public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/112706] missed simplification in FRE
Date: Fri, 24 Nov 2023 21:52:39 +0000	[thread overview]
Message-ID: <bug-112706-4-dqpdV1hEMY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112706-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Jan Hubicka <hubicka at ucw dot cz> ---
Thanks, new pattern looks like noticeable improvement :)
Base+offset is effective for alias analysis and I suppose it happens
reasonably enough for compares as well.
>   _76 = _71 + 4;
>   # .MEM_154 = VDEF <.MEM_153>
>   x_3(D)->D.25942._M_implD.25172.D.25249._M_finishD.25175 = _76;
>   # .MEM_7 = VDEF <.MEM_154>
>   D.26033 = 0;
>   # .MEM_157 = VDEF <.MEM_7>
>   *_76 = 0;
>   # PT = nonlocal escaped 
>   _82 = _71 + 8;
>   # .MEM_158 = VDEF <.MEM_157>
>   x_3(D)->D.25942._M_implD.25172.D.25249._M_finishD.25175 = _82;
>   # .MEM_8 = VDEF <.MEM_158>
>   D.26033 ={v} {CLOBBER(eol)};
>   # .MEM_9 = VDEF <.MEM_8>
>   D.26034 = 0;
>   if (_66 != _82)
> ```
> After pre (note the first comparison is gone but not the second one and maybe a
> 3rd). So this patch helps but it looks like a PRE/VN improvement is still
> needed to fix the others.
I think it is missing predication in VN. At each execution of CCP or VN
we work out one conditional to be true, but we stil account both paths
for the value number of the pointer used in next compare.

If vector used base+size pair instead of base+endptr VRP would help
here, but we can't vrp finish-start range...

  parent reply	other threads:[~2023-11-24 21:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24 19:52 [Bug middle-end/112706] New: " hubicka at gcc dot gnu.org
2023-11-24 19:58 ` [Bug tree-optimization/112706] " pinskia at gcc dot gnu.org
2023-11-24 21:36 ` pinskia at gcc dot gnu.org
2023-11-24 21:52 ` hubicka at ucw dot cz [this message]
2023-11-27  8:03 ` rguenth at gcc dot gnu.org
2023-11-27  8:43 ` rguenth at gcc dot gnu.org
2023-11-27  9:43 ` cvs-commit at gcc dot gnu.org
2023-11-27  9:44 ` rguenth 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-112706-4-dqpdV1hEMY@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).