From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: Andrew Pinski <pinskia@gmail.com>,
Segher Boessenkool <segher@kernel.crashing.org>
Cc: "mfortune@gmail.com" <mfortune@gmail.com>,
"dave.anglin@bell.net" <dave.anglin@bell.net>,
"rguenther@suse.de" <rguenther@suse.de>,
"aoliva@gcc.gnu.org" <aoliva@gcc.gnu.org>,
"richard.sandiford@arm.com" <richard.sandiford@arm.com>,
"uweigand@de.ibm.com" <uweigand@de.ibm.com>,
"hubicka@ucw.cz" <hubicka@ucw.cz>,
"marcus.shawcroft@arm.com" <marcus.shawcroft@arm.com>,
"olegendo@gcc.gnu.org" <olegendo@gcc.gnu.org>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
"linkw@gcc.gnu.org" <linkw@gcc.gnu.org>,
"richard.earnshaw@arm.com" <richard.earnshaw@arm.com>,
"ramana.radhakrishnan@arm.com" <ramana.radhakrishnan@arm.com>,
"davem@redhat.com" <davem@redhat.com>,
"gnu@amylaar.uk" <gnu@amylaar.uk>,
"Liu, Hongtao" <hongtao.liu@intel.com>,
"claziss@synopsys.com" <claziss@synopsys.com>,
"dje.gcc@gmail.com" <dje.gcc@gmail.com>
Subject: Re: [PATCH 1/2] Add a parameter for the builtin function of prefetch to align with LLVM
Date: Fri, 21 Oct 2022 11:17:39 +0100 [thread overview]
Message-ID: <06133b91-6950-878e-c8e5-f7f0ffc34b51@foss.arm.com> (raw)
In-Reply-To: <CA+=Sn1k9OUWcYSy8srjLJ977e2g2M6+Tm=7jadHmCX7PqtNYxQ@mail.gmail.com>
On 20/10/2022 18:37, Andrew Pinski via Gcc-patches wrote:
> On Thu, Oct 20, 2022 at 10:28 AM Segher Boessenkool
> <segher@kernel.crashing.org> wrote:
>>
>> On Thu, Oct 20, 2022 at 01:44:15AM +0000, Jiang, Haochen wrote:
>>> Maybe the testcase change cause some misunderstanding and concern.
>>>
>>> Actually, the patch did not disrupt the previous builtins, as the builtin_prefetch
>>> uses vargs. I set the default value of the new parameter as data prefetch, which
>>> means that if we are not using the fourth parameter, just like how we use
>>> prefetch previously, it is still what it is.
>>
>> I still think it is a mistake to have one builtin do two very distinct
>> operations, only very superficially related. Instruction fetch and data
>> demand loads are almosty entirely unrelated, and so is the prefetch
>> machinery for them, on all machines I am familiar with.
>
> On aarch64 (armv8), it is actually the same instruction: PRFM. It
> might be the only one which is that way though.
> It even allows to specify the level for the instruction prefetch too
> (which is actually useful for say OcteonTX2 which has an interesting
> cache hierarchy).
>
Just because the encodings are similar doesn't mean that the
instructions are the same, although it's true that once you reach
unification in the cache hierarchy the end behaviour /might/ be
indistinguishable.
Really, Segher's point seems to be 'why overload the existing builtin
for this'? It's not like the new parameter is something that users
would really need to pass in as a run-time choice; and that wouldn't
work anyway because in the end we do need distinct instructions.
R.
> Though I agree it is a mistake to have one builtin which handles both
> data and instruction prefetch.
>
> Thanks,
> Andrew
>
>
>> Which makes
>> sense anyway, since instruction prefetch and data prefetch have
>> completely different performance characteristics and considerations.
>> Maybe if you start with the mistake of having unified L1 caches it
>> seems natural, but thankfully most machines do not do that.
>>
>>
>> Segher
next prev parent reply other threads:[~2022-10-21 10:17 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-14 8:34 [PATCH 0/2] Add a Fourth parameter for prefetch and Support Intel PREFETCHI Haochen Jiang
2022-10-14 8:34 ` [PATCH 1/2] Add a parameter for the builtin function of prefetch to align with LLVM Haochen Jiang
2022-10-14 8:46 ` Hongtao Liu
2022-10-17 15:28 ` Richard Earnshaw
2022-10-18 9:20 ` [PATCH v2] " Haochen Jiang
2022-10-19 17:14 ` [PATCH 1/2] " Andrew Pinski
2022-10-19 21:14 ` Segher Boessenkool
2022-10-20 1:27 ` Hongtao Liu
2022-10-20 1:44 ` Jiang, Haochen
2022-10-20 17:25 ` Segher Boessenkool
2022-10-20 17:37 ` Andrew Pinski
2022-10-21 10:17 ` Richard Earnshaw [this message]
2022-10-21 18:08 ` Segher Boessenkool
2022-10-19 21:06 ` Segher Boessenkool
2022-10-20 1:39 ` Hongtao Liu
2022-10-20 3:12 ` Hongtao Liu
2022-10-20 18:44 ` Segher Boessenkool
2022-10-20 7:34 ` Jiang, Haochen
2022-10-20 18:54 ` Segher Boessenkool
2022-10-21 3:17 ` Jiang, Haochen
2022-10-24 10:00 ` Richard Sandiford
2022-10-24 21:19 ` Segher Boessenkool
2022-10-14 8:34 ` [PATCH 2/2] Support Intel prefetchit0/t1 Haochen Jiang
2022-10-20 3:45 ` H.J. Lu
2022-10-20 4:04 ` Hongtao Liu
2022-10-19 20:49 ` [PATCH 0/2] Add a Fourth parameter for prefetch and Support Intel PREFETCHI Segher Boessenkool
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=06133b91-6950-878e-c8e5-f7f0ffc34b51@foss.arm.com \
--to=richard.earnshaw@foss.arm.com \
--cc=aoliva@gcc.gnu.org \
--cc=claziss@synopsys.com \
--cc=dave.anglin@bell.net \
--cc=davem@redhat.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gnu@amylaar.uk \
--cc=hongtao.liu@intel.com \
--cc=hubicka@ucw.cz \
--cc=linkw@gcc.gnu.org \
--cc=marcus.shawcroft@arm.com \
--cc=mfortune@gmail.com \
--cc=olegendo@gcc.gnu.org \
--cc=pinskia@gmail.com \
--cc=ramana.radhakrishnan@arm.com \
--cc=rguenther@suse.de \
--cc=richard.earnshaw@arm.com \
--cc=richard.sandiford@arm.com \
--cc=segher@kernel.crashing.org \
--cc=uweigand@de.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).