public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/110587] [14 regression] 96% pr28071.c compile time regression since r14-2337-g37a231cc7594d1
Date: Mon, 17 Jul 2023 11:42:04 +0000	[thread overview]
Message-ID: <bug-110587-4-UdQpxkJWbI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110587-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
I wonder what the following does anyway.  We delete the noop move
only when either the reg isn't used for return or it isn't in
use in later insns between 'insn' and the next set of it.
That seems to detect the hardreg = X; USE (hardreg); return sequence
and wants to protect that despite X being the same as 'hardreg'.

          /* IRA can generate move insns involving pseudos.  It is
             better remove them earlier to speed up compiler a bit.
             It is also better to do it here as they might not pass
             final RTL check in LRA, (e.g. insn moving a control
             register into itself).  So remove an useless move insn
             unless next insn is USE marking the return reg (we should
             save this as some subsequent optimizations assume that
             such original insns are saved).  */
          if (NONJUMP_INSN_P (insn) && GET_CODE (pat) == SET
              && REG_P (SET_SRC (pat)) && REG_P (SET_DEST (pat))
              && REGNO (SET_SRC (pat)) == REGNO (SET_DEST (pat))
              && (! return_regno_p (REGNO (SET_SRC (pat)))
                  || ! regno_in_use_p (insn, REGNO (SET_SRC (pat)))))

what's odd is of course that return_regno_p returns true so much for this
testcase.

The return sequence to protect should be easily discoverable by walking
from the function exit and thus could be marked instead of trying to
match it to each insn like above.

But I don't understand why we want to preserve this noop copy anyway ...

  parent reply	other threads:[~2023-07-17 11:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-07  9:52 [Bug middle-end/110587] New: 96% pr28071.c compile time regression betwen g:8377cf1bf41a0a9d9d49de807b2341f0bf5d30cf and g:3a61ca1b9256535e1bfb19b2d46cde21f3908a5d hubicka at gcc dot gnu.org
2023-07-15 14:11 ` [Bug middle-end/110587] " jamborm at gcc dot gnu.org
2023-07-15 17:20 ` [Bug middle-end/110587] [14 regression] 96% pr28071.c compile time regression since r14-2337-g37a231cc7594d1 pinskia at gcc dot gnu.org
2023-07-15 17:21 ` [Bug rtl-optimization/110587] " pinskia at gcc dot gnu.org
2023-07-17  6:27 ` crazylht at gmail dot com
2023-07-17  6:28 ` crazylht at gmail dot com
2023-07-17  8:56 ` jamborm at gcc dot gnu.org
2023-07-17  9:13 ` rguenth at gcc dot gnu.org
2023-07-17 10:52 ` jamborm at gcc dot gnu.org
2023-07-17 11:09 ` rguenth at gcc dot gnu.org
2023-07-17 11:26 ` roger at nextmovesoftware dot com
2023-07-17 11:42 ` rguenth at gcc dot gnu.org [this message]
2023-07-17 16:04 ` roger at nextmovesoftware dot com
2023-07-18  8:25 ` rguenth at gcc dot gnu.org
2023-07-22 20:55 ` cvs-commit at gcc dot gnu.org
2023-07-25  8:38 ` rguenth at gcc dot gnu.org
2023-07-25  8:44 ` roger at nextmovesoftware dot com
2023-07-27 18:28 ` roger at nextmovesoftware dot com
2023-07-28  8:40 ` cvs-commit at gcc dot gnu.org
2023-08-02  7:04 ` cvs-commit at gcc dot gnu.org
2023-08-02  7:47 ` rguenth at gcc dot gnu.org
2023-08-02  9:11 ` ubizjak at gmail dot com
2023-08-02  9:45 ` rguenth at gcc dot gnu.org
2023-08-09  6:48 ` 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-110587-4-UdQpxkJWbI@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).