[PATCH, rs6000] Fix PR92760 by checking VECTOR_MEM_NONE_P instead

Kewen.Lin linkw@linux.ibm.com
Tue Dec 3 09:38:00 GMT 2019


Hi,

PR92760 exposed one issue that VECTOR_UNIT_NONE_P (V2DImode) is true on Power7
then we won't return it as preferred_simd_mode but ISA 2.06 (Power7) does 
introduce partial support on vector doubleword (very limitted) and more basic
support origins from ISA 2.07 (Power8) though.  To make vectorizer still
leverage those few but available V2DImode related instructions, we need to
claim it's available on VSX (Power7 and up).

Instead of using VECTOR_UNIT_NONE_P, this fix is to use VECTOR_MEM_NONE_P
instead.  I was intended to use both VECTOR_UNIT_NONE_P and VECTOR_MEM_NONE_P
together but noticed that MEM is like a super set of UNIT in current
implementation, I think it would be enough.

Bootstrapped and tested on powerpc64le-linux-gnu (P8 LE) and ppc64-redhat-linux
(P7 BE).  Also verified the failures in the PR gone.

Is it ok for trunk?

BR,
Kewen
----
gcc/ChangeLog

2019-12-03  Kewen Lin  <linkw@gcc.gnu.org>

	PR target/92760
	* gcc/config/rs6000/rs6000.c (rs6000_preferred_simd_mode): Update
	VECTOR_UNIT_NONE_P by VECTOR_MEM_NONE_P.
-------------- next part --------------
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 3c22f64..23b6d99 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4917,7 +4917,7 @@ rs6000_preferred_simd_mode (scalar_mode mode)
 {
   opt_machine_mode vmode = mode_for_vector (mode, 16 / GET_MODE_SIZE (mode));
 
-  if (vmode.exists () && !VECTOR_UNIT_NONE_P (vmode.require ()))
+  if (vmode.exists () && !VECTOR_MEM_NONE_P (vmode.require ()))
     return vmode.require ();
 
   return word_mode;


More information about the Gcc-patches mailing list