public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Hongtao Liu via Gcc-patches <gcc-patches@gcc.gnu.org>,
	Vladimir Makarov <vmakarov@redhat.com>,
	Hongtao Liu <crazylht@gmail.com>,
	dcb314@hotmail.com
Subject: Re: [PATCH][PR target/97540] Don't extract memory from operand for normal memory constraint.
Date: Thu, 29 Oct 2020 17:16:51 +0000	[thread overview]
Message-ID: <mptwnz97y0s.fsf@arm.com> (raw)
In-Reply-To: <20201029110156.GD3788@tucnak> (Jakub Jelinek's message of "Thu,  29 Oct 2020 12:01:56 +0100")

Jakub Jelinek <jakub@redhat.com> writes:
> On Tue, Oct 27, 2020 at 11:13:21AM +0000, Richard Sandiford via Gcc-patches wrote:
>> Sorry to stick my oar in, but I think we should reconsider the
>> bcst_mem_operand approach.  It seems like these patches (and the
>> previous one) are fighting against the principle that operands
>> cannot be arbitrary expressions.
>
> Many operands already are fairly complex expressions, so it is unclear how
> this changes that.

But the things subject to constraint matching currently have to be
SCRATCHes, SUBREGs, REGs, MEMs or constants.  The address inside
a MEM can be complex, but even that has certain limits (so that LRA
knows what to do with addresses that need reloading).

Matching something like VEC_DUPLICATE in a constraint is new in
that thing being constrained isn't conceptually an object
(only the operand of the VEC_DUPLICATE is).

> And LRA etc. already handles SUBREGs of MEM which is kind of similar to
> this.

Yeah, but SUBREGs of MEMs are a bit of a legacy feature :-)
It would be great to remove them at some point…

>> This kind of thing was attempted long ago (even before my time!)
>> for SIGN_EXTEND on MIPS.  It ended up causing more problems than
>> it solved and in the end it had to be taken out.  I'm worried that
>> we might end up going through the same cycle again.
>> 
>> Also, this LRA code is extremely performance-sensitive in terms
>> of compile time: it's often at the top or near the top of the profile.
>> So adding calls to new functions like extract_mem_from_operand for
>> a fairly niche case probably isn't a good trade-off.
>
> It can be just an inline function that looks through just the target
> selected rtxes rather than arbitrary ones (derived from *.md properties or
> something).

Having something in the .md file sounds good.  The more information the
generators have, the more chance they have to do something efficient.

>> I think we should instead find a nice(?) syntax for generating separate
>> patterns for the two bcst_vector_operand alternatives from a single
>> .md pattern.  That would fit the existing model much more closely.
>
> That would result in thousands of new patterns, I'm not sure it is a good
> idea.  Pretty much all AVX512* instructions allow those.

Yeah, I hadn't realised that.

Thanks,
Richard

  reply	other threads:[~2020-10-29 17:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27  6:53 Hongtao Liu
2020-10-27 11:13 ` Richard Sandiford
2020-10-28  1:32   ` Hongtao Liu
2020-10-28 18:46     ` Richard Sandiford
2020-10-29  1:20       ` Hongtao Liu
2020-10-29 17:00         ` Richard Sandiford
2020-11-02  7:12           ` Hongtao Liu
2020-11-02 19:03             ` Richard Sandiford
2020-10-29  5:33   ` Hongtao Liu
2020-10-29 17:03     ` Richard Sandiford
2020-10-31 17:16       ` Hans-Peter Nilsson
2020-10-29 11:01   ` Jakub Jelinek
2020-10-29 17:16     ` Richard Sandiford [this message]
2020-11-02 19:40 ` Vladimir Makarov
2020-11-03 13:51   ` Richard Sandiford
2020-11-04  5:14     ` Hongtao Liu
2020-11-04 10:19       ` Richard Sandiford

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=mptwnz97y0s.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=crazylht@gmail.com \
    --cc=dcb314@hotmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=vmakarov@redhat.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).