public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] vect/test: Don't check for epilogue loop [PR97075]
@ 2020-09-18  2:37 Kewen.Lin
  2020-09-18 15:46 ` Segher Boessenkool
  2020-09-18 18:17 ` Richard Sandiford
  0 siblings, 2 replies; 13+ messages in thread
From: Kewen.Lin @ 2020-09-18  2:37 UTC (permalink / raw)
  To: GCC Patches
  Cc: Segher Boessenkool, Bill Schmidt, Richard Biener,
	Richard Sandiford, Andrea Corallo

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

Hi,

The commit r11-3230 brings a nice improvement to use full
vectors instead of partial vectors when available.  But
it caused some vector with length test cases to fail on
Power.

The failure on gcc.target/powerpc/p9-vec-length-epil-7.c
exposed one issue that: we call function 
vect_need_peeling_or_partial_vectors_p in function
vect_analyze_loop_2, since it's in analysis phase, for
the epilogue loop, we could get the wrong information like
LOOP_VINFO_INT_NITERS (loop_vinfo), further get the wrong
answer for vect_need_peeling_or_partial_vectors_p.
For the epilogue loop in this failure specific, the niter
that we get is 58 (should be 1), vf is 2.

For epilogue loop with partial vectors, it would use the
same VF as the main loop, so it won't be able to use full
vector, this patch is to exclude epilogue loop for the
check vect_need_peeling_or_partial_vectors_p in
vect_analyze_loop_2.

The failure on gcc.target/powerpc/p9-vec-length-full-6.c
is just a test issue, the 64bit/32bit pairs are able to
use full vector, fixed in the patch accordingly.

Bootstrapped/regtested on powerpc64le-linux-gnu P9.

Is it OK for trunk?

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

	* tree-vect-loop.c (vect_analyze_loop_2): Don't check
	vect_need_peeling_or_partial_vectors_p for the epilogue loop.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/p9-vec-length-full-6.c: Adjust.

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

diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c
index cfae9bbc927..5d2357aabfa 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c
@@ -9,8 +9,7 @@
 #include "p9-vec-length-6.h"
 
 /* It can use normal vector load for constant vector load.  */
-/* { dg-final { scan-assembler-not   {\mstxv\M} } } */
-/* { dg-final { scan-assembler-not   {\mlxvx\M} } } */
-/* { dg-final { scan-assembler-not   {\mstxvx\M} } } */
-/* { dg-final { scan-assembler-times {\mlxvl\M} 16 } } */
-/* { dg-final { scan-assembler-times {\mstxvl\M} 16 } } */
+/* { dg-final { scan-assembler-times {\mstxvx?\M} 6 } } */
+/* 64bit/32bit pairs won't use partial vectors.  */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 10 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 10 } } */
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index ab627fbf029..7273e998a99 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2278,7 +2278,8 @@ start_over:
     {
       /* Don't use partial vectors if we don't need to peel the loop.  */
       if (param_vect_partial_vector_usage == 0
-	  || !vect_need_peeling_or_partial_vectors_p (loop_vinfo))
+	  || (!LOOP_VINFO_EPILOGUE_P (loop_vinfo)
+	      && !vect_need_peeling_or_partial_vectors_p (loop_vinfo)))
 	LOOP_VINFO_USING_PARTIAL_VECTORS_P (loop_vinfo) = false;
       else if (vect_verify_full_masking (loop_vinfo)
 	       || vect_verify_loop_lens (loop_vinfo))

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

end of thread, other threads:[~2020-09-24  2:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18  2:37 [PATCH] vect/test: Don't check for epilogue loop [PR97075] Kewen.Lin
2020-09-18 15:46 ` Segher Boessenkool
2020-09-18 18:17 ` Richard Sandiford
2020-09-20 14:03   ` Kewen.Lin
2020-09-21  6:50     ` Richard Sandiford
2020-09-22  3:23       ` Kewen.Lin
2020-09-21  7:29   ` Andrea Corallo
2020-09-21  8:32     ` Richard Sandiford
2020-09-22 14:34       ` [PATCH] vect: Fix epilogue loop handling of partial vectors Richard Sandiford
2020-09-23  3:07         ` Kewen.Lin
2020-09-23 11:33           ` Richard Sandiford
2020-09-24  2:35             ` Kewen.Lin
2020-09-23  7:58         ` Richard Biener

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).