aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorWilco Dijkstra <wilco.dijkstra@arm.com>2025-03-03 16:47:32 +0000
committerWilco Dijkstra <wilco.dijkstra@arm.com>2025-03-06 17:37:07 +0000
commitf870302515d5fcf7355f0108c3ead0038ff326fd (patch)
treedfd4cf54c1e1d6400a46e3dba4b32ebff0e9c2d1 /gcc
parent179e01085b0aed111ef1f7908c4b87c800f880e9 (diff)
downloadgcc-f870302515d5fcf7355f0108c3ead0038ff326fd.zip
gcc-f870302515d5fcf7355f0108c3ead0038ff326fd.tar.gz
gcc-f870302515d5fcf7355f0108c3ead0038ff326fd.tar.bz2
AArch64: Enable early scheduling for -O3 and higher (PR118351)
Enable the early scheduler on AArch64 for O3/Ofast. This means GCC15 benefits from much faster build times with -O2, but avoids the regressions in lbm which is very sensitive to minor scheduling changes due to long FMA chains. gcc: PR target/118351 PR other/38768 * common/config/aarch64/aarch64-common.cc: Enable early scheduling with -O3 and higher. * doc/invoke.texi (-fschedule-insns): Update comment.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/common/config/aarch64/aarch64-common.cc4
-rw-r--r--gcc/doc/invoke.texi4
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc
index 500bf78..b9ed836 100644
--- a/gcc/common/config/aarch64/aarch64-common.cc
+++ b/gcc/common/config/aarch64/aarch64-common.cc
@@ -53,8 +53,10 @@ static const struct default_options aarch_option_optimization_table[] =
{ OPT_LEVELS_ALL, OPT_fomit_frame_pointer, NULL, 0 },
/* Enable -fsched-pressure by default when optimizing. */
{ OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 },
- /* Disable early scheduling due to high compile-time overheads. */
+ /* Except for -O3 and higher, disable early scheduling due to high
+ compile-time overheads. */
{ OPT_LEVELS_ALL, OPT_fschedule_insns, NULL, 0 },
+ { OPT_LEVELS_3_PLUS, OPT_fschedule_insns, NULL, 1 },
/* Enable redundant extension instructions removal at -O2 and higher. */
{ OPT_LEVELS_2_PLUS, OPT_free, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_mearly_ra_, NULL, AARCH64_EARLY_RA_ALL },
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 6f0779b..304de88 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -13507,7 +13507,9 @@ helps machines that have slow floating point or memory load instructions
by allowing other instructions to be issued until the result of the load
or floating-point instruction is required.
-Enabled at levels @option{-O2}, @option{-O3}.
+Conventionally enabled at optimization levels @option{-O2} and @option{-O3}.
+However, many targets override this behavior. For example, on x86, it is
+disabled at all levels, while on AArch64, it is enabled only at @option{-O3}.
@opindex fschedule-insns2
@item -fschedule-insns2