public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Eric Botcazou <botcazou@adacore.com>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	Jeff Law <jeffreyalaw@gmail.com>,
	gcc-patches@gcc.gnu.org, richard.sandiford@arm.com
Subject: Re: [PATCH] pro_and_epilogue: Call df_note_add_problem () if SHRINK_WRAPPING_ENABLED [PR112760]
Date: Sat, 2 Dec 2023 23:45:26 +0100	[thread overview]
Message-ID: <ZWuzhonam7r54YV8@tucnak> (raw)
In-Reply-To: <mptbkb8c1cr.fsf@arm.com>

On Sat, Dec 02, 2023 at 11:04:04AM +0000, Richard Sandiford wrote:
> I still maintain that so much stuff relies on the lack of false-positive
> REG_UNUSED notes that (whatever the intention might have been) we need
> to prevent the false positive.  Like Andrew says, any use of single_set
> is suspect if there's a REG_UNUSED note for something that is in fact used.

The false positive REG_UNUSED in that case comes from
(insn 15 14 35 2 (set (reg:CCZ 17 flags)
        (compare:CCZ (reg:DI 0 ax [111])
            (reg:DI 1 dx [112]))) "pr112760.c":11:22 12 {*cmpdi_1}
     (expr_list:REG_UNUSED (reg:CCZ 17 flags)
        (nil)))
(insn 35 15 36 2 (set (reg:CCZ 17 flags)
        (compare:CCZ (reg:DI 0 ax [111])
            (reg:DI 1 dx [112]))) "pr112760.c":11:22 12 {*cmpdi_1}
     (expr_list:REG_DEAD (reg:DI 1 dx [112])
        (expr_list:REG_DEAD (reg:DI 0 ax [111])
            (nil))))
...
use of flags
Haven't verified what causes the redundant comparison, but postreload cse
then does:
110	      if (!count && cselib_redundant_set_p (body))
111		{
112		  if (check_for_inc_dec (insn))
113		    delete_insn_and_edges (insn);
114		  /* We're done with this insn.  */
115		  goto done;
116		}
So, we'd in such cases need to look up what instruction was the earlier
setter and if it has REG_UNUSED note, drop it.

	Jakub


  parent reply	other threads:[~2023-12-02 22:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-02 10:44 Jakub Jelinek
2023-12-02 11:04 ` Richard Sandiford
2023-12-02 12:15   ` Eric Botcazou
2023-12-02 13:15     ` Richard Sandiford
2023-12-02 19:30       ` Richard Biener
2023-12-02 22:45   ` Jakub Jelinek [this message]
2023-12-04 10:59     ` Richard Sandiford
2023-12-04 17:30       ` [PATCH] Maintain a validity flag for REG_UNUSED notes [PR112760] (was Re: [PATCH] pro_and_epilogue: Call df_note_add_problem () if SHRINK_WRAPPING_ENABLED [PR112760]) Richard Sandiford
2023-12-04 19:34         ` Jakub Jelinek
2023-12-04  2:56   ` [PATCH] pro_and_epilogue: Call df_note_add_problem () if SHRINK_WRAPPING_ENABLED [PR112760] Andrew Pinski

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=ZWuzhonam7r54YV8@tucnak \
    --to=jakub@redhat.com \
    --cc=botcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=richard.sandiford@arm.com \
    --cc=segher@kernel.crashing.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).