public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000: Set param_vect_partial_vector_usage as 1 for P10
@ 2020-11-25  6:02 Kewen.Lin
  2020-11-25 15:42 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Kewen.Lin @ 2020-11-25  6:02 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool, Bill Schmidt, David Edelsohn

[-- Attachment #1: Type: text/plain, Size: 855 bytes --]

Hi,

This patch is to set param_vect_partial_vector_usage as 1 on P10
by default.  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.  The performance evaluation
on the whole SPEC2017 with latest trunk and option set power10/
Ofast/unroll shows it can speed up 525.x264_r by 10.80% and
554.roms_r by 1.94%.  One remarkable degradation is 523.xalancbmk_r
-1.79% but it's identified not directly related to this enablement
by some investigation.

Bootstrapped/regtested on powerpc64le-linux-gnu P10.

Is it ok for trunk?

BR,
Kewen
------
gcc/ChangeLog:

	* config/rs6000/rs6000.c (rs6000_option_override_internal):
	Set param_vect_partial_vector_usage as 1 for Power10 and up
	by default.

[-- Attachment #2: vec_len_p10.diff --]
[-- Type: text/plain, Size: 1147 bytes --]

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index d8ac2f0cd2f..c956d5a605b 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4781,10 +4781,14 @@ 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);
+      if (TARGET_POWER10)
+       SET_OPTION_IF_UNSET (&global_options, &global_options_set,
+			    param_vect_partial_vector_usage, 1);
+      else
+       /* Disable it on the default supported hardware Power9 since
+	  lxvl/stxvl have unexpected performance behaviors.  */
+       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,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rs6000: Set param_vect_partial_vector_usage as 1 for P10
  2020-11-25  6:02 [PATCH] rs6000: Set param_vect_partial_vector_usage as 1 for P10 Kewen.Lin
@ 2020-11-25 15:42 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2020-11-25 15:42 UTC (permalink / raw)
  To: Kewen.Lin; +Cc: GCC Patches, Bill Schmidt, David Edelsohn

Hi!

On Wed, Nov 25, 2020 at 02:02:16PM +0800, Kewen.Lin wrote:
> This patch is to set param_vect_partial_vector_usage as 1 on P10
> by default.  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.  The performance evaluation
> on the whole SPEC2017 with latest trunk and option set power10/
> Ofast/unroll shows it can speed up 525.x264_r by 10.80% and
> 554.roms_r by 1.94%.  One remarkable degradation is 523.xalancbmk_r
> -1.79% but it's identified not directly related to this enablement
> by some investigation.


> +      if (TARGET_POWER10)
> +       SET_OPTION_IF_UNSET (&global_options, &global_options_set,
> +			    param_vect_partial_vector_usage, 1);
> +      else
> +       /* Disable it on the default supported hardware Power9 since
> +	  lxvl/stxvl have unexpected performance behaviors.  */
> +       SET_OPTION_IF_UNSET (&global_options, &global_options_set,
> +			    param_vect_partial_vector_usage, 0);

Maybe write this like

      /* 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);

Okay for trunk with such a comment (before the "if").  Thanks!


Segher

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-25 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  6:02 [PATCH] rs6000: Set param_vect_partial_vector_usage as 1 for P10 Kewen.Lin
2020-11-25 15:42 ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).