This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 5/6][AArch64] Enable -fprefetch-loop-arrays at -O3 for cores that benefit from prefetching.
- From: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- To: Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Andrew Pinski <apinski at cavium dot com>, Richard Guenther <richard dot guenther at gmail dot com>
- Date: Mon, 30 Jan 2017 12:23:44 +0000
- Subject: Re: [PATCH 5/6][AArch64] Enable -fprefetch-loop-arrays at -O3 for cores that benefit from prefetching.
- Authentication-results: sourceware.org; auth=none
- References: <F7C2520D-866C-4293-831D-815BF466DFA2@linaro.org> <CABFF4CD-C5A5-4DBF-99EA-ED1F7D984430@linaro.org>
Hi Maxim,
On 30/01/17 12:06, Maxim Kuvyrkov wrote:
This patch enables prefetching at -O3 for aarch64 cores that set "simultaneous prefetches" parameter above 0. There are currently no such settings, so this patch doesn't change default code generation.
I'm now working on improvements to -fprefetch-loop-arrays pass to make it suitable for -O2. I'll post this work in the next month.
Bootstrapped and regtested on x86_64-linux-gnu and aarch64-linux-gnu.
Are you aiming to get this in for GCC 8?
I have one small comment on this patch:
+ /* Enable sw prefetching at -O3 for CPUS that have prefetch, and we
+ have deemed it beneficial (signified by setting
+ prefetch.num_slots to 1 or more). */
+ if (flag_prefetch_loop_arrays < 0
+ && HAVE_prefetch
HAVE_prefetch will always be true on aarch64.
I imagine midend code that had logic like this would need this check, but aarch64-specific code shouldn't need it.
+ && optimize >= 3
+ && aarch64_tune_params.prefetch.num_slots > 0)
+ flag_prefetch_loop_arrays = 1;
+
Cheers,
Kyrill