From: Segher Boessenkool <segher@kernel.crashing.org>
To: Jeff Law <law@redhat.com>
Cc: Xionghu Luo <luoxhu@linux.ibm.com>,
"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
jakub@redhat.com, bonzini@gnu.org, ebotcazou@gcc.gnu.org,
abel@gcc.gnu.org
Subject: Re: CSE deletes valid REG_EQUAL?
Date: Fri, 13 Nov 2020 07:55:16 -0600 [thread overview]
Message-ID: <20201113135516.GU2672@gate.crashing.org> (raw)
In-Reply-To: <b0c3bed3-9f6e-4729-cb72-0ba81aa3810d@redhat.com>
Hi guys,
On Thu, Nov 12, 2020 at 09:10:14PM -0700, Jeff Law wrote:
> On 11/12/20 7:02 PM, Xionghu Luo via Gcc wrote:
> > The output shows "REQ_EQUAL r118:DI+0x66546b64" is deleted by df_remove_dead_eq_notes,
> > but r120:DI is not REG_DEAD here, so is it correct here to check insn use and find that
> > r118:DI is dead then do the delete?
>
> It doesn't matter where the death occurs, any REG_DEAD note will cause
> the REG_EQUAL note to be removed. So given the death note for r118,
> then any REG_EQUAL note that references r118 will be removed. This is
> overly pessimistic as the note may still be valid/useful at some
> points. See
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92291
The note even *always* is valid where it is! As you say, the REG_EQUAL
is only (necessarily) valid at *that* insn. And this insn *sets* the
reg (that is the only case when a REG_EQ* is allowed at all), so if the
eq reg is dead (i.e. unused) the whole insn is, and the insn can be
removed.
Removing all REG_EQUAL notes for regs that become dead anywhere seems
to just be a thinko? All pseudos are dead somewhere! (Yeah okay,
infinite loops, but other than that.)
Segher
next prev parent reply other threads:[~2020-11-13 13:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 2:02 Xionghu Luo
2020-11-13 4:10 ` Jeff Law
2020-11-13 13:55 ` Segher Boessenkool [this message]
2020-11-17 1:12 ` Jeff Law
2020-11-17 8:57 ` Paolo Bonzini
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=20201113135516.GU2672@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=abel@gcc.gnu.org \
--cc=bonzini@gnu.org \
--cc=ebotcazou@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=law@redhat.com \
--cc=luoxhu@linux.ibm.com \
/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).