public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/78103] Failure to optimize with __builtin_clzl
Date: Tue, 27 Jul 2021 15:25:41 +0000	[thread overview]
Message-ID: <bug-78103-4-DcGiC4v593@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-78103-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #20 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #18)
> (In reply to Segher Boessenkool from comment #17)
> > > Nothing changes for combine though, I think it really would be nice if it
> > > could either change newly added pseudos from combine_split_insns by i2dest
> > > if possible,
> > 
> > Is that ever safe to do?
> 
> Except for debug insns if the mode is the same and i2dest doesn't appear in
> i2set nor i3set nor anything in between, why not?

You need to do the same twenty not-very-trivial-and-not-cheap-either checks
as we have to do in similar cases.  And try to get that right :-/

You also need to check i2dest does no longer appear in the new i2 and i3,
for example.

And for what?  What is the benefit?

> > > or better handle new pseudos from both combine_split_insns and
> > > when
> > > for find_split_point i2dest can't be resued with creating LOG_LINKS.
> > 
> > You cannot safely attempt to combine the two insns split to again, neither
> > alone nor in combination with other insns.  Since pretty much by definition
> > that new reg will be set in the new i2 and used in (only) in the new i3,
> > no combination with that new reg is valid ever?
> 
> Sure, combining those 2 insns can't be sucessful, otherwise it would have
> matched earlier.  But they can be combined with other insns, say the first
> of those 2 split insns being i0 and second i1 combined into some other i3
> and i2,
> or perhaps just split insns i1 and i2 combined into some other i3.

But there is nothing checking anything of the sort, and that would be really
awkward to fit in with the existing mechanics, if it is possible at all.

  parent reply	other threads:[~2021-07-27 15:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-78103-4@http.gcc.gnu.org/bugzilla/>
2021-07-24  6:20 ` pinskia at gcc dot gnu.org
2021-07-24 12:28 ` jakub at gcc dot gnu.org
2021-07-26 10:57 ` jakub at gcc dot gnu.org
2021-07-26 11:14 ` jakub at gcc dot gnu.org
2021-07-26 11:22 ` jakub at gcc dot gnu.org
2021-07-26 12:11 ` jakub at gcc dot gnu.org
2021-07-26 21:01 ` segher at gcc dot gnu.org
2021-07-26 21:08 ` jakub at gcc dot gnu.org
2021-07-26 21:26 ` segher at gcc dot gnu.org
2021-07-27  8:52 ` jakub at gcc dot gnu.org
2021-07-27 12:35 ` segher at gcc dot gnu.org
2021-07-27 12:41 ` jakub at gcc dot gnu.org
2021-07-27 13:53 ` jakub at gcc dot gnu.org
2021-07-27 15:25 ` segher at gcc dot gnu.org [this message]
2021-07-27 15:37 ` segher at gcc dot gnu.org
2021-07-31  7:21 ` cvs-commit at gcc dot gnu.org
2021-07-31  8:24 ` jakub at gcc dot gnu.org
2021-08-01 20:33 ` cvs-commit 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-78103-4-DcGiC4v593@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).