New target check: vect_peeling_profitable
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Wed, 4 Oct 2017 12:00:34 +0000 (12:00 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Wed, 4 Oct 2017 12:00:34 +0000 (12:00 +0000)
gcc/ChangeLog:

2017-10-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* doc/sourcebuild.texi: Document vect_peeling_profitable.

gcc/testsuite/ChangeLog:

2017-10-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* g++.dg/vect/slp-pr56812.cc: xfail for targets which don't want
vector loop peeling.
* lib/target-supports.exp (check_effective_target_vect_peeling_profitable):
New proc.

From-SVN: r253407

gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/vect/slp-pr56812.cc
gcc/testsuite/lib/target-supports.exp

index fb76db2ec4a20e2d983de67967f116b9b6744697..7ad2fe0ba9b3ffe4743daea2da7b02502402197e 100644 (file)
@@ -1,3 +1,7 @@
+2017-10-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       * doc/sourcebuild.texi: Document vect_peeling_profitable.
+
 2017-10-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * doc/sourcebuild.texi: Document vect_intdouble_cvt and
index e09bca102f030f4c3a4c6319d3881df9701c60cf..1646d0a99911aa7b2e66762e5907fbb0454ed00d 100644 (file)
@@ -1404,6 +1404,9 @@ Target supports a vector misalign access.
 @item vect_no_align
 Target does not support a vector alignment mechanism.
 
+@item vect_peeling_profitable
+Target might require to peel loops for alignment purposes.
+
 @item vect_no_int_min_max
 Target does not support a vector min and max instruction on @code{int}.
 
index f06b7b2e74f087a6ec9fd413c042c1eeb795fc9f..62991d5583e167be8ec4bf712f63a1c190127a17 100644 (file)
@@ -1,3 +1,10 @@
+2017-10-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       * g++.dg/vect/slp-pr56812.cc: xfail for targets which don't want
+       vector loop peeling.
+       * lib/target-supports.exp (check_effective_target_vect_peeling_profitable):
+       New proc.
+
 2017-10-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * gcc.dg/vect/pr66251.c: Replace vect_floatint_cvt with
index 80bdcddd11e802daf6740d18ae360f8e228aa048..8b24b337efa602198c96504cbe647cfc3b1cd5ff 100644 (file)
@@ -17,4 +17,6 @@ void mydata::Set (float x)
     data[i] = x;\r
 }\r
 \r
-/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" } } */\r
+/* For targets without vector loop peeling the loop becomes cheap\r
+   enough to be vectorized.  */\r
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { xfail { ! vect_peeling_profitable } } } } */\r
index 4f752ec25290479d0ec5ccc9fbf38fd7484f1d21..b6f9e51c4817cf8235c8e33b14e2763308eb482a 100644 (file)
@@ -3277,6 +3277,28 @@ proc check_effective_target_vect_floatuint_cvt { } {
     return $et_vect_floatuint_cvt_saved($et_index)
 }
 
+# Return 1 if peeling for alignment might be profitable on the target
+#
+
+proc check_effective_target_vect_peeling_profitable { } {
+    global et_vect_peeling_profitable_saved
+    global et_index
+
+    if [info exists et_vect_peeling_profitable_saved($et_index)] {
+       verbose "check_effective_target_vect_peeling_profitable: using cached result" 2
+    } else {
+       set et_vect_peeling_profitable_saved($et_index) 1
+        if { ([istarget s390*-*-*]
+             && [check_effective_target_s390_vx]) } {
+           set et_vect_peeling_profitable_saved($et_index) 0
+        }
+    }
+
+    verbose "check_effective_target_vect_peeling_profitable:\
+            returning $et_vect_peeling_profitable_saved($et_index)" 2
+    return $et_vect_peeling_profitable_saved($et_index)
+}
+
 # Return 1 if the target supports #pragma omp declare simd, 0 otherwise.
 #
 # This won't change for different subtargets so cache the result.