public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: gcc-patches@gcc.gnu.org, Andreas Krebbel <krebbel@gcc.gnu.org>,
	Stefan Liebler <stli@linux.ibm.com>
Subject: Re: [PATCH] fwprop: Fix single_use_p calculation
Date: Mon, 22 Mar 2021 22:55:50 +0000	[thread overview]
Message-ID: <mptblbax0g9.fsf@arm.com> (raw)
In-Reply-To: <e9e4c35c73d17dcf385adb106fef8c11a0e81823.camel@linux.ibm.com> (Ilya Leoshkevich's message of "Mon, 22 Mar 2021 21:48:17 +0100")

Ilya Leoshkevich <iii@linux.ibm.com> writes:
> On Mon, 2021-03-22 at 18:23 +0000, Richard Sandiford wrote:
>> Ilya Leoshkevich <iii@linux.ibm.com> writes:
>
> [...]
>
>> > Do you still want me to add single_nondebug_use() for completeness
>> > in
>> > this patch, or would it be better to add it later when it's
>> > actually
>> > needed?
>> 
>> I was thinking that the fwprop.c code would use
>> def->single_nondebug_use () instead of
>> def->single_nondebug_insn_use () && !def->has_phi_uses ().
>
> But these two are not equivalent, are they?  single_nondebug_use()
> that you proposed explicitly allows phis:
>
>   // If there is exactly one nondebug use of the set's result,
>   // return that use, otherwise return null.  The use might be in
>   // instruction or a phi node.
>   use_info *single_nondebug_use () const;
>
> but I don't think we want to propagate into phis here.
> Or should the check be a bit bigger, like the following?

But we're in the process of substituting the definition into an
insn use.  So we know that an insn use exists.  I think the
question we're trying to answer is: is this insn use the only
nondebug use?  I'd rather test that with a single accessor rather
than break it down into individual data structure tests.

Thanks,
Richard

  reply	other threads:[~2021-03-22 22:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 22:37 Ilya Leoshkevich
2021-03-03 18:34 ` Jeff Law
2021-03-03 20:05   ` Ilya Leoshkevich
2021-03-15 15:00 ` Stefan Liebler
2021-03-21 13:19 ` Richard Sandiford
2021-03-22 14:45   ` Ilya Leoshkevich
2021-03-22 18:23     ` Richard Sandiford
2021-03-22 20:48       ` Ilya Leoshkevich
2021-03-22 22:55         ` Richard Sandiford [this message]
2021-03-22 23:15           ` Ilya Leoshkevich
2021-03-22 22:38 Ilya Leoshkevich

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=mptblbax0g9.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iii@linux.ibm.com \
    --cc=krebbel@gcc.gnu.org \
    --cc=stli@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).