From: Jeff Law <law@redhat.com>
To: "Thomas Preud'homme" <thomas.preudhomme@arm.com>,
Steven Bosscher <stevenb.gcc@gmail.com>,
gcc-patches@gcc.gnu.org,
"'Richard Biener'" <rguenther@suse.de>
Subject: Re: [PATCH, GCC, stage1] Fallback to copy-prop if constant-prop not possible
Date: Fri, 24 Apr 2015 03:15:00 -0000 [thread overview]
Message-ID: <5539B530.4030803@redhat.com> (raw)
In-Reply-To: <000501d07e3c$30f53c20$92dfb460$@arm.com>
On 04/23/2015 09:10 PM, Thomas Preud'homme wrote:
>> From: Jeff Law [mailto:law@redhat.com]
>> Sent: Friday, April 24, 2015 10:59 AM
>>
>
> Hi Jeff,
>
>>> +
>>> +static bool
>>> +cprop_reg_p (const_rtx x)
>>> +{
>>> + return REG_P (x) && !HARD_REGISTER_P (x);
>>> +}
>> How about instead this move to a more visible location (perhaps a macro
>> in regs.h or an inline function). Then as a followup, change the
>> various places that have this sequence to use that common definition
>> that exist outside of cprop.c.
>
> According to Steven this was proposed in the past but was refused (see
> end of [1]).
>
> [1] https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01066.html
Missed that message. Given we've already gone round and round on it,
let go with the patch as-is and deal with hard_register_p and
pseudo_register_p independently. No idea who objected to that, seems
like a no-brainer to me.
>
>>
>>> @@ -1191,7 +1192,7 @@ do_local_cprop (rtx x, rtx_insn *insn)
>>> /* Rule out USE instructions and ASM statements as we don't want
>> to
>>> change the hard registers mentioned. */
>>> if (REG_P (x)
>>> - && (REGNO (x) >= FIRST_PSEUDO_REGISTER
>>> + && (cprop_reg_p (x)
>>> || (GET_CODE (PATTERN (insn)) != USE
>>> && asm_noperands (PATTERN (insn)) < 0)))
>> Isn't the REG_P test now redundant?
>
> I made the same mistake when reviewing that change and indeed it's not.
> Note the opening parenthesis before cprop_reg_p that contains a bitwise
> OR expression. So in the case where cprop_reg_p is false, REG_P still
> needs to be true.
>
> We could keep a check on FIRST_PSEUDO_REGISTER but the intent (checking
> that the register is suitable for propagation) is clearer now, as pointed out by
> Steven to me.
Ah. Nevermind then.
So revised review is "ok for the trunk" :-)
jeff
next prev parent reply other threads:[~2015-04-24 3:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-16 10:26 Thomas Preud'homme
2015-02-16 10:54 ` Richard Biener
2015-02-16 12:06 ` Steven Bosscher
2015-02-16 20:20 ` Steven Bosscher
2015-02-17 2:51 ` Thomas Preud'homme
2015-03-04 8:52 ` Thomas Preud'homme
2015-03-20 7:55 ` Steven Bosscher
2015-03-20 8:36 ` Thomas Preud'homme
2015-03-20 10:27 ` Thomas Preud'homme
2015-03-20 12:14 ` Steven Bosscher
2015-03-23 11:01 ` Thomas Preud'homme
2015-03-23 11:57 ` Steven Bosscher
2015-03-30 4:58 ` Thomas Preud'homme
2015-04-13 12:47 ` Jeff Law
2015-04-14 8:00 ` Thomas Preud'homme
2015-04-16 8:44 ` Thomas Preud'homme
2015-04-23 9:15 ` Steven Bosscher
2015-04-24 2:59 ` Jeff Law
2015-04-24 3:11 ` Thomas Preud'homme
2015-04-24 3:15 ` Jeff Law [this message]
2015-04-24 4:53 ` Thomas Preud'homme
2015-04-30 7:43 ` Bin.Cheng
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=5539B530.4030803@redhat.com \
--to=law@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=rguenther@suse.de \
--cc=stevenb.gcc@gmail.com \
--cc=thomas.preudhomme@arm.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).