diff options
author | guojiufu <guojiufu@linux.ibm.com> | 2020-05-28 14:10:39 +0800 |
---|---|---|
committer | guojiufu <guojiufu@linux.ibm.com> | 2020-06-07 17:35:01 +0800 |
commit | 557a40f599f64e40cc1b20254bf82acc775375f5 (patch) | |
tree | a32cdb789ddf90ae978852b305e81673e7af5951 /gcc | |
parent | 71489d8e7572388c6e9528a45e4942b7c7b67e4f (diff) | |
download | gcc-557a40f599f64e40cc1b20254bf82acc775375f5.zip gcc-557a40f599f64e40cc1b20254bf82acc775375f5.tar.gz gcc-557a40f599f64e40cc1b20254bf82acc775375f5.tar.bz2 |
rs6000: allow cunroll to grow size according to -funroll-loop or -fpeel-loops
Previously, flag_unroll_loops was turned on at -O2 implicitly. This
also turned on cunroll with allowance size increasing, and cunroll
will unroll/peel the loop even the loop is complex like code in PR95018.
With this patch, size growth for cunroll is allowed only for if -funroll-loops
or -fpeel-loops or -O3 is specified explicitly.
gcc/ChangeLog
2020-06-07 Jiufu Guo <guojiufu@linux.ibm.com>
PR target/95018
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Override flag_cunroll_grow_size.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 42d517c..ff09e93 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4567,7 +4567,12 @@ rs6000_option_override_internal (bool global_init_p) unroll_only_small_loops = 0; if (!global_options_set.x_flag_rename_registers) flag_rename_registers = 1; + if (!global_options_set.x_flag_cunroll_grow_size) + flag_cunroll_grow_size = 1; } + else + if (!global_options_set.x_flag_cunroll_grow_size) + flag_cunroll_grow_size = flag_peel_loops || optimize >= 3; /* If using typedef char *va_list, signal that __builtin_va_start (&ap, 0) can be optimized to |