public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/113651] The GCC optimizer performs poorly on a very simple code snippet.
Date: Tue, 30 Jan 2024 07:09:37 +0000	[thread overview]
Message-ID: <bug-113651-4-G8q2BP0uOw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113651-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
                 CC|                            |pinskia at gcc dot gnu.org

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> Whether this is better suited for GIMPLE or RTL if-conversion remains to be
> seen.

I suspect we could do something in isel. phiopt has something similar for casts
already though too. I have some ideas on how we undo the conditional xor and
then see if we do another phiopt if so don't put it back as conditional. And
then in isel if we see `a ? x ^ CST : 0` do it as `x ^ (a ? CST : 0)` if the
target has cmov but there needs to be some cost model; I am not sure how
though.

(I still wonder if x86's cmov has improved in recent years so that doing 2 cmov
back to back still worse than a branch; LLVM seems not to care about doing cmov
cost model and the performance there is ok).

      parent reply	other threads:[~2024-01-30  7:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 11:01 [Bug c++/113651] New: " cuking998244353 at gmail dot com
2024-01-29 12:38 ` [Bug middle-end/113651] " rguenth at gcc dot gnu.org
2024-01-30  7:09 ` pinskia at gcc dot gnu.org [this message]

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-113651-4-G8q2BP0uOw@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).