From af8955112f4d3294d9cc50a2a125718b202321f0 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Thu, 3 Mar 2022 15:06:21 +0100 Subject: 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. --- gcc/common/config/s390/s390-common.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/common') diff --git a/gcc/common/config/s390/s390-common.cc b/gcc/common/config/s390/s390-common.cc index 72a5ef4..be3e6f2 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 }, -- cgit v1.1