From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 200563856974; Fri, 21 Oct 2022 18:09:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 200563856974 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 29LI8DYS005671; Fri, 21 Oct 2022 13:08:13 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 29LI8B39005668; Fri, 21 Oct 2022 13:08:11 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 21 Oct 2022 13:08:11 -0500 From: Segher Boessenkool To: Richard Earnshaw Cc: Andrew Pinski , "mfortune@gmail.com" , "dave.anglin@bell.net" , "rguenther@suse.de" , "aoliva@gcc.gnu.org" , "richard.sandiford@arm.com" , "uweigand@de.ibm.com" , "hubicka@ucw.cz" , "marcus.shawcroft@arm.com" , "olegendo@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" , "linkw@gcc.gnu.org" , "richard.earnshaw@arm.com" , "ramana.radhakrishnan@arm.com" , "davem@redhat.com" , "gnu@amylaar.uk" , "Liu, Hongtao" , "claziss@synopsys.com" , "dje.gcc@gmail.com" Subject: Re: [PATCH 1/2] Add a parameter for the builtin function of prefetch to align with LLVM Message-ID: <20221021180811.GZ25951@gate.crashing.org> References: <20221014083406.8406-1-haochen.jiang@intel.com> <20221014083406.8406-2-haochen.jiang@intel.com> <20221019211421.GQ25951@gate.crashing.org> <20221020172558.GS25951@gate.crashing.org> <06133b91-6950-878e-c8e5-f7f0ffc34b51@foss.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <06133b91-6950-878e-c8e5-f7f0ffc34b51@foss.arm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Oct 21, 2022 at 11:17:39AM +0100, Richard Earnshaw wrote: > On 20/10/2022 18:37, Andrew Pinski via Gcc-patches wrote: > >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. "Might", yes: for good results the hardware has to use very different heuristics. And of course it interacts with the hardware prefetchers anyway (which are very different for code and data, and work a lot better than software prefetch almost always for that matter). > 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. Right. The builtin as well as the RTL expressions. But having nasty builtin definitions hurts our users, and nasty RTL only ourselves ;-) Segher