diff mbox series

[committed] vect: Check partial vector param for supports_partial_vectors [PR104015]

Message ID 43967e6c-9a08-7b77-ad04-f3e801fca17b@linux.ibm.com
State New
Headers show
Series [committed] vect: Check partial vector param for supports_partial_vectors [PR104015] | expand

Commit Message

Kewen.Lin Jan. 14, 2022, 1:06 p.m. UTC

As described in PR104015, the function partial_vectors_supported_p
mainly checks optabs for partial vectors support query, but we
still have one parameter param_vect_partial_vector_usage to control
the capability.

Power9 introduces vector with length instructions (for
len_load/len_store) but we don't enable partial vector on it by
default. It should be considered as not supporting partial vector by
default. This fix is to make the flag supports_partial_vectors check
param_vect_partial_vector_usage accordingly.

This was approved by Richard in the PR, thanks Richard and Andre for
the comments, pushed via r12-6582.


	PR tree-optimization/104015
	* tree-vect-loop.c (vect_analyze_loop): Check
	param_vect_partial_vector_usage for supports_partial_vectors.

diff mbox series


diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index ba67de490bb..49d53fb3383 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -3026,7 +3026,8 @@  vect_analyze_loop (class loop *loop, vec_info_shared *shared)
   vector_modes[0] = autodetected_vector_mode;
   mode_i = 0;

-  bool supports_partial_vectors = partial_vectors_supported_p ();
+  bool supports_partial_vectors =
+    partial_vectors_supported_p () && param_vect_partial_vector_usage != 0;
   poly_uint64 first_vinfo_vf = LOOP_VINFO_VECT_FACTOR (first_loop_vinfo);

   while (1)