diff mbox

Testsuite fixes for failures caused by patch for PR 80925 - loop peeling and alignment

Message ID 1501193805.28549.115.camel@cavium.com
State New
Headers show

Commit Message

Steve Ellcey July 27, 2017, 10:16 p.m. UTC
I was looking at the latest aarch64 failures and noticed PR 80925.  There
seems to be a consensus to change the tests to reflect the current loop
peeling behaviour so I have created a patch to do that.  There are three
issues with this patch that might need fixing before it can be checked in.

One, I fixed this for aarch64 but not power8.  I don't have a power system
and I am not sure how to specify it in check_effective_target_vect_peel_align.
Maybe someone on the power side can update and test the patch to address
that.

Two, I tried to include a change to gcc.dg/vect/vect-93.c which is one of 
the tests that started failing and I could never get it to pass cleanly,
no matter how many times I tweaked the dg-final statements, so I gave up
and left that test out.

Three, I was a little concerned about the test g++.dg/vect/slp-pr56812.cc,
it looks different than the others and does not mention peeling, but it
was affected by the same checkins as the others.

Any comments from the power and/or vectorizer folks?

Steve Ellcey
sellcey@cavium.com


2017-07-27  Steve Ellcey  <sellcey@cavium.com>

	PR tree-optimization/80925
	* gcc.dg/vect/no-section-anchors-vect-69.c: Add vect_peel_align target
	and xfail.
	* g++.dg/vect/slp-pr56812.cc: Add vect_peel_align target.
	* gcc.dg/vect/section-anchors-vect-69.c: Ditto.
	* gcc.dg/vect/vect-28.c: Ditto.
	* gcc.dg/vect/vect-33-big-array.c: Ditto.
	* gcc.dg/vect/vect-70.c: Ditto.
	* gcc.dg/vect/vect-87.c: Ditto.
	* gcc.dg/vect/vect-91.c: Ditto.
	* lib/target-supports.exp (check_effective_target_vect_peel_align):
	New.

Comments

Richard Biener July 28, 2017, 7:47 a.m. UTC | #1
On Fri, Jul 28, 2017 at 12:16 AM, Steve Ellcey <sellcey@cavium.com> wrote:
> I was looking at the latest aarch64 failures and noticed PR 80925.  There
> seems to be a consensus to change the tests to reflect the current loop
> peeling behaviour so I have created a patch to do that.  There are three
> issues with this patch that might need fixing before it can be checked in.
>
> One, I fixed this for aarch64 but not power8.  I don't have a power system
> and I am not sure how to specify it in check_effective_target_vect_peel_align.
> Maybe someone on the power side can update and test the patch to address
> that.
>
> Two, I tried to include a change to gcc.dg/vect/vect-93.c which is one of
> the tests that started failing and I could never get it to pass cleanly,
> no matter how many times I tweaked the dg-final statements, so I gave up
> and left that test out.
>
> Three, I was a little concerned about the test g++.dg/vect/slp-pr56812.cc,
> it looks different than the others and does not mention peeling, but it
> was affected by the same checkins as the others.
>
> Any comments from the power and/or vectorizer folks?

On one side I'm inclined to simplify the testsuite by adding
--param vect-max-peeling-for-alignment=0 in addition to
-fno-vect-cost-model we already pass and override that in the
tests that specifically exercise peeling for alignment (do we have any?).
OTOH that would remove quite some testing coverage of prologue
peeling.

So ideally testresults would be clean with both no such --param
and that --param added...

I think most of the testcases you needed to adjust have nothing
to do with peeling for alignment thus adding this --param just for
those (and simplifying their dump scanning accordingly) is another
pragmatic option.

Adding yet another target (vect_peel_align) is IMHO not good,
especially as this one depends on cost tuning and not HW
features, so it's impossible(?) to dynamically compute it
with a test compile for example (we _do_ want a clean
vect.exp with any vector HW / tuning switch you add).

Richard.

> Steve Ellcey
> sellcey@cavium.com
>
>
> 2017-07-27  Steve Ellcey  <sellcey@cavium.com>
>
>         PR tree-optimization/80925
>         * gcc.dg/vect/no-section-anchors-vect-69.c: Add vect_peel_align target
>         and xfail.
>         * g++.dg/vect/slp-pr56812.cc: Add vect_peel_align target.
>         * gcc.dg/vect/section-anchors-vect-69.c: Ditto.
>         * gcc.dg/vect/vect-28.c: Ditto.
>         * gcc.dg/vect/vect-33-big-array.c: Ditto.
>         * gcc.dg/vect/vect-70.c: Ditto.
>         * gcc.dg/vect/vect-87.c: Ditto.
>         * gcc.dg/vect/vect-91.c: Ditto.
>         * lib/target-supports.exp (check_effective_target_vect_peel_align):
>         New.
diff mbox

Patch

diff --git a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
index 80bdcdd..3040341 100644
--- a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
+++ b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
@@ -17,4 +17,4 @@  void mydata::Set (float x)
     data[i] = x;
 }
 
-/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" } } */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { target { vect_peel_align } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
index fe968de..63f3bc4 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
@@ -114,7 +114,7 @@  int main (void)
 } 
 
 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { {! vector_alignment_reachable} || { vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { vect_peel_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_peel_align || { {! vector_alignment_reachable} || { vect_sizes_32B_16B} } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_peel_align || { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c b/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c
index 8c88e5f..873af82 100644
--- a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c
+++ b/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c
@@ -112,8 +112,8 @@  int main (void)
 } 
 
 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_int } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect"  { target vect_peel_align } } } */
 /* Alignment forced using versioning until the pass that increases alignment
   is extended to handle structs.  */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target {vect_int && vector_alignment_reachable } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { { vect_int && vect_peel_align } && vector_alignment_reachable } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target {vect_int && {! vector_alignment_reachable} } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-28.c b/gcc/testsuite/gcc.dg/vect/vect-28.c
index b28fbd9..0e5aaa5 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-28.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-28.c
@@ -39,6 +39,6 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect"  { target { vect_peel_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_peel_align && vector_alignment_reachable } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-33-big-array.c b/gcc/testsuite/gcc.dg/vect/vect-33-big-array.c
index 5ad3953..5843f8e 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-33-big-array.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-33-big-array.c
@@ -38,6 +38,6 @@  int main (void)
 
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target vector_alignment_reachable } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect"  target { vect_peel_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_peel_align && vector_alignment_reachable } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-70.c b/gcc/testsuite/gcc.dg/vect/vect-70.c
index 0ec06a2..181d898 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-70.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-70.c
@@ -63,6 +63,6 @@  int main (void)
 }
           
 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable} } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect"  { target vect_peel_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vect_peel_align && vector_alignment_reachable} } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target {{! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-87.c b/gcc/testsuite/gcc.dg/vect/vect-87.c
index 4f74397..fca9f55 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-87.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-87.c
@@ -50,6 +50,6 @@  int main (void)
 
 /* Fails for targets that don't vectorize PLUS (e.g alpha).  */
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable} } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target vect_peel_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vect_peel_align && vector_alignment_reachable } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-88.c b/gcc/testsuite/gcc.dg/vect/vect-88.c
index f35c525..991c632 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-88.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-88.c
@@ -50,6 +50,6 @@  int main (void)
 
 /* Fails for targets that don't vectorize PLUS (e.g alpha).  */
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable } } }  */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target vect_peel_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vect_peel_align && vector_alignment_reachable } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-91.c b/gcc/testsuite/gcc.dg/vect/vect-91.c
index de9d5d1..67749cb 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-91.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-91.c
@@ -60,5 +60,5 @@  main3 ()
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { xfail vect_no_int_add } } } */
 /* { dg-final { scan-tree-dump-times "accesses have the same alignment." 3 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
 /* { dg-final { scan-tree-dump-times "accesses have the same alignment." 2 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target { vector_alignment_reachable } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target { vect_peel_align && vector_alignment_reachable } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 5a65627..21dd085 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8284,6 +8284,25 @@  proc check_effective_target_vect_max_reduc { } {
     return 0
 }
 
+# Return 1 if the target does not support inexpensive unaligned vector stores
+# and loops should be peeled for better performance.
+
+proc check_effective_target_vect_peel_align { } {
+    global et_vect_peel_align_saved
+
+    if [info exists et_vect_peel_align_saved] {
+	verbose "check_effective_target_vect_peel_align: using cached result" 2
+    } else {
+	set et_vect_peel_align_saved 1
+	if { [istarget aarch64*-*-*] } {
+	    set et_vect_peel_align_saved 0
+	}
+    }
+    verbose "check_effective_target_vect_unaligned:\
+             returning $et_vect_peel_align_saved" 2
+    return $et_vect_peel_align_saved
+}
+
 # Return 1 if there is an nvptx offload compiler.
 
 proc check_effective_target_offload_nvptx { } {