public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@linaro.org>
To: gcc-patches@gcc.gnu.org
Subject: [8/10] Add a vect_variable_length target selector
Date: Fri, 03 Nov 2017 16:21:00 -0000	[thread overview]
Message-ID: <87inerpc2z.fsf@linaro.org> (raw)
In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri,	03 Nov 2017 16:14:44 +0000")

This patch adds a target selector for variable-length vectors.
Initially it's always false, but the SVE patch provides a case
in which it's true.


2017-11-03  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* doc/sourcebuild.texi (vect_variable_length): Document.

gcc/testsuite/
	* lib/target-supports.exp
	(check_effective_target_vect_variable_length): New proc.
	* gcc.dg/vect/pr60482.c: XFAIL test for no epilog loop if
	vect_variable_length.
	* gcc.dg/vect/slp-reduc-6.c: XFAIL two-operation SLP if
	vect_variable_length.
	* gcc.dg/vect/vect-alias-check-5.c: XFAIL alias optimization if
	vect_variable_length.
	* gfortran.dg/vect/fast-math-mgrid-resid.f: XFAIL predictive
	commoning optimization if vect_variable_length.

Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi	2017-11-03 16:06:26.237889385 +0000
+++ gcc/doc/sourcebuild.texi	2017-11-03 16:06:52.929591350 +0000
@@ -1486,6 +1486,9 @@ Target prefers vectors to have an alignm
 alignment, but also allows unaligned vector accesses in some
 circumstances.
 
+@item vect_variable_length
+Target has variable-length vectors.
+
 @item vect_widen_sum_hi_to_si
 Target supports a vector widening summation of @code{short} operands
 into @code{int} results, or can promote (unpack) from @code{short}
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	2017-11-03 16:06:26.241888136 +0000
+++ gcc/testsuite/lib/target-supports.exp	2017-11-03 16:06:52.930591737 +0000
@@ -6714,6 +6714,12 @@ proc check_effective_target_vect_multipl
     return [expr { [llength [available_vector_sizes]] > 1 }]
 }
 
+# Return true if variable-length vectors are supported.
+
+proc check_effective_target_vect_variable_length { } {
+    return [expr { [lindex [available_vector_sizes] 0] == 0 }]
+}
+
 # Return 1 if the target supports vectors of 64 bits.
 
 proc check_effective_target_vect64 { } {
Index: gcc/testsuite/gcc.dg/vect/pr60482.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr60482.c	2015-06-02 23:53:38.000000000 +0100
+++ gcc/testsuite/gcc.dg/vect/pr60482.c	2017-11-03 16:06:52.929591350 +0000
@@ -16,4 +16,6 @@ foo (double *x, int n)
   return p;
 }
 
-/* { dg-final { scan-tree-dump-not "epilog loop required" "vect" } } */
+/* Until fully-masked loops are supported, we always need an epilog
+   loop for variable-length vectors.  */
+/* { dg-final { scan-tree-dump-not "epilog loop required" "vect" { xfail vect_variable_length } } } */
Index: gcc/testsuite/gcc.dg/vect/slp-reduc-6.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/slp-reduc-6.c	2015-06-02 23:53:35.000000000 +0100
+++ gcc/testsuite/gcc.dg/vect/slp-reduc-6.c	2017-11-03 16:06:52.929591350 +0000
@@ -44,5 +44,5 @@ int main (void)
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_int_add || { ! { vect_unpack || vect_strided2 } } } } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "different interleaving chains in one node" 1 "vect" { target { ! vect_no_int_add } } } } */
+/* { dg-final { scan-tree-dump-times "different interleaving chains in one node" 1 "vect" { target { ! vect_no_int_add } xfail vect_variable_length } } } */
 
Index: gcc/testsuite/gcc.dg/vect/vect-alias-check-5.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-alias-check-5.c	2017-08-04 11:39:37.910284386 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-alias-check-5.c	2017-11-03 16:06:52.929591350 +0000
@@ -15,5 +15,5 @@ f1 (struct s *a, struct s *b)
 }
 
 /* { dg-final { scan-tree-dump-times "consider run-time aliasing" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "improved number of alias checks from 1 to 0" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "improved number of alias checks from 1 to 0" 1 "vect" { xfail vect_variable_length } } } */
 /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 1 "vect" } } */
Index: gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f
===================================================================
--- gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f	2017-10-04 16:25:39.620051123 +0100
+++ gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f	2017-11-03 16:06:52.929591350 +0000
@@ -42,5 +42,5 @@ C
 ! vectorized loop.  If vector factor is 2, the vectorized loop can
 ! be predictive commoned, we check if predictive commoning PHI node
 ! is created with vector(2) type.
-! { dg-final { scan-tree-dump "Executing predictive commoning without unrolling" "pcom" } }
-! { dg-final { scan-tree-dump "vectp_u.*__lsm.* = PHI <.*vectp_u.*__lsm" "pcom" } }
+! { dg-final { scan-tree-dump "Executing predictive commoning without unrolling" "pcom" { xfail vect_variable_length } } }
+! { dg-final { scan-tree-dump "vectp_u.*__lsm.* = PHI <.*vectp_u.*__lsm" "pcom" { xfail vect_variable_length } } }

  parent reply	other threads:[~2017-11-03 16:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 16:14 [0/10] Vectoriser testsuite tweaks Richard Sandiford
2017-11-03 16:16 ` [1/10] Consistently use asm volatile ("" ::: "memory") in vect tests Richard Sandiford
2017-11-08 19:10   ` Jeff Law
2017-11-03 16:17 ` [2/10] Add VECTOR_BITS to tree-vect.h Richard Sandiford
2017-11-08 19:13   ` Jeff Law
2017-11-03 16:18 ` [3/10] Add available_vector_sizes to target-supports.exp Richard Sandiford
2017-11-08 19:13   ` Jeff Law
2017-11-17 13:23     ` Christophe Lyon
2017-11-03 16:18 ` [4/10] Don't assume vect_multiple_sizes means 2 sizes Richard Sandiford
2017-11-08 19:21   ` Jeff Law
2017-11-03 16:19 ` [5/10] Add vect_perm3_* target selectors Richard Sandiford
2017-11-08 19:49   ` Jeff Law
2017-11-03 16:20 ` [6/10] Add a vect_element_align_preferred target selector Richard Sandiford
2017-11-08 22:31   ` Jeff Law
2017-11-03 16:21 ` Richard Sandiford [this message]
2017-11-08 22:33   ` [8/10] Add a vect_variable_length " Jeff Law
2017-11-03 16:21 ` [7/10] Add a vect_unaligned_possible " Richard Sandiford
2017-11-08 22:32   ` Jeff Law
2017-11-03 16:22 ` [9/10] Add a vect_align_stack_vars " Richard Sandiford
2017-11-08 22:40   ` Jeff Law
2017-11-03 16:23 ` [10/10] Add a vect_masked_store " Richard Sandiford
2017-11-08 22:44   ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87inerpc2z.fsf@linaro.org \
    --to=richard.sandiford@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).