From: Kewen Lin Date: Thu, 26 Nov 2020 09:20:40 +0000 (-0600) Subject: rs6000: Set param_vect_partial_vector_usage as 1 for P10 X-Git-Tag: basepoints/gcc-12~2822 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6702584aa372de7790b3f2be9e4b5a5423eb9fa;p=thirdparty%2Fgcc.git rs6000: Set param_vect_partial_vector_usage as 1 for P10 Due to the unexpected performance on Power9 of those vector with length instructions, we didn't enable vectorization with partial vectors before. Some recent testings show that they perform expectedly on Power10 now. This patch is to set param_vect_partial_vector_usage as 1 for P10 or later. The performance evaluation on the whole SPEC2017 with option set power10/Ofast/unroll shows it can speed up 525.x264_r by 10.80% and 554.roms_r by 1.94%. Bootstrapped/regtested on powerpc64le-linux-gnu P10. gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_option_override_internal): Set param_vect_partial_vector_usage as 1 for Power10 and up by default. --- diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index d8ac2f0cd2f2..50261b3ad7f7 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4781,10 +4781,13 @@ rs6000_option_override_internal (bool global_init_p) SET_OPTION_IF_UNSET (&global_options, &global_options_set, param_max_completely_peeled_insns, 400); - /* Temporarily disable it for now since lxvl/stxvl on the default - supported hardware Power9 has unexpected performance behaviors. */ - SET_OPTION_IF_UNSET (&global_options, &global_options_set, - param_vect_partial_vector_usage, 0); + /* The lxvl/stxvl instructions don't perform well before Power10. */ + if (TARGET_POWER10) + SET_OPTION_IF_UNSET (&global_options, &global_options_set, + param_vect_partial_vector_usage, 1); + else + SET_OPTION_IF_UNSET (&global_options, &global_options_set, + param_vect_partial_vector_usage, 0); /* Use the 'model' -fsched-pressure algorithm by default. */ SET_OPTION_IF_UNSET (&global_options, &global_options_set,