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 target/82666] [11/12/13/14 regression]: sum += (x>128 ? x : 0) puts the cmov on the critical path (at -O2)
Date: Fri, 04 Aug 2023 00:40:03 +0000	[thread overview]
Message-ID: <bug-82666-4-HBmRxloedo@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-82666-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't know if this could help here but combine does produce:
Trying 37, 34 -> 38:
   37: flags:CCGC=cmp(r82:SI,0x7f)
      REG_DEAD r82:SI
   34: {r92:DI=r87:DI+r89:DI;clobber flags:CC;}
      REG_DEAD r89:DI
      REG_UNUSED flags:CC
   38: r87:DI={(flags:CCGC>0)?r92:DI:r87:DI}
      REG_DEAD r92:DI
      REG_DEAD flags:CCGC
Failed to match this instruction:
(set (reg/v:DI 87 [ <retval> ])
    (plus:DI (mult:DI (gt:DI (reg:SI 82 [ _4 ])
                (const_int 127 [0x7f]))
            (reg:DI 89 [ _4 ]))
        (reg/v:DI 87 [ <retval> ])))

I don't know if we could catch this in the backend and split this into 3
instructions if that would do the right thing ...

  parent reply	other threads:[~2023-08-04  0:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-82666-4@http.gcc.gnu.org/bugzilla/>
2021-05-14  9:49 ` [Bug target/82666] [9/10/11/12 regression]: sum += (x>128/9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:09 ` rguenth at gcc dot gnu.org
2022-05-27  9:37 ` [Bug target/82666] [10/11/12/13 regression]: sum += (x>128 " rguenth at gcc dot gnu.org
2022-06-28 10:33 ` jakub at gcc dot gnu.org
2023-07-07 10:32 ` [Bug target/82666] [11/12/13/14 " rguenth at gcc dot gnu.org
2023-08-04  0:40 ` pinskia at gcc dot gnu.org [this message]
2023-08-04  4:18 ` law 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-82666-4-HBmRxloedo@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).