diff options
author | Robin Dapp <rdapp@linux.ibm.com> | 2022-03-03 15:06:21 +0100 |
---|---|---|
committer | Robin Dapp <rdapp@linux.ibm.com> | 2022-08-29 11:15:09 +0200 |
commit | af8955112f4d3294d9cc50a2a125718b202321f0 (patch) | |
tree | af1b4ea676c7a53a69e062c57837de56d153c6da /gcc/common | |
parent | 9b3cd1755be55fbed5f86fd55bb1a6c3279f1fc4 (diff) | |
download | gcc-af8955112f4d3294d9cc50a2a125718b202321f0.tar.gz |
s390: Add -munroll-only-small-loops.
Inspired by Power we also introduce -munroll-only-small-loops. This
implies activating -funroll-loops and -munroll-only-small-loops at -O2 and
above.
gcc/ChangeLog:
* common/config/s390/s390-common.cc: Enable -funroll-loops and
-munroll-only-small-loops for OPT_LEVELS_2_PLUS_SPEED_ONLY.
* config/s390/s390.cc (s390_loop_unroll_adjust): Do not unroll
loops larger than 12 instructions.
(s390_override_options_after_change): Set unroll options.
(s390_option_override_internal): Likewise.
* config/s390/s390.opt: Document munroll-only-small-loops.
gcc/testsuite/ChangeLog:
* gcc.target/s390/vector/vec-copysign.c: Do not unroll.
* gcc.target/s390/zvector/autovec-double-quiet-uneq.c: Dito.
* gcc.target/s390/zvector/autovec-double-signaling-ltgt.c: Dito.
* gcc.target/s390/zvector/autovec-float-quiet-uneq.c: Dito.
* gcc.target/s390/zvector/autovec-float-signaling-ltgt.c: Dito.
Diffstat (limited to 'gcc/common')
-rw-r--r-- | gcc/common/config/s390/s390-common.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/common/config/s390/s390-common.cc b/gcc/common/config/s390/s390-common.cc index 72a5ef47eaa..be3e6f20142 100644 --- a/gcc/common/config/s390/s390-common.cc +++ b/gcc/common/config/s390/s390-common.cc @@ -64,6 +64,11 @@ static const struct default_options s390_option_optimization_table[] = /* Enable -fsched-pressure by default when optimizing. */ { OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 }, + /* Enable -munroll-only-small-loops with -funroll-loops to unroll small + loops at -O2 and above by default. */ + { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_funroll_loops, NULL, 1 }, + { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_munroll_only_small_loops, NULL, 1 }, + /* ??? There are apparently still problems with -fcaller-saves. */ { OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 }, |