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: PR81738: Split vect-alias-check-6.c
Date: Thu, 10 Aug 2017 13:42:00 -0000	[thread overview]
Message-ID: <87y3qrv8zw.fsf@linaro.org> (raw)

The second loop in the testcase only vectorises if we can reverse
a vector and if aligned loads aren't required.

Sanity-checked on aarch64-linux-gnu, x86_64-linux-gnu and
powerpc64le-linux-gnu (although all three were unaffected).
OK to install?

Thanks,
Richard


2017-08-10  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/testsuite/
	PR testsuite/81738
	* gcc.dg/vect/vect-alias-check-6.c: Move second function to...
	* gcc.dg/vect/vect-alias-check-7.c: ...this new file.  Require
	vect_perm and vect_element_align for vectorization.

Index: gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c	2017-08-04 11:40:26.372205514 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c	2017-08-10 14:36:24.201888108 +0100
@@ -12,12 +12,5 @@ f1 (struct s *a, struct s *b)
     a->x[i + 1] += b->x[i];
 }
 
-void
-f2 (struct s *a, struct s *b)
-{
-  for (int i = 0; i < N; ++i)
-    a->x[i] += b->x[N - i - 1];
-}
-
-/* { dg-final { scan-tree-dump-times {checking that [^\n]* and [^\n]* have different addresses} 2 "vect" } } */
-/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */
+/* { dg-final { scan-tree-dump {checking that [^\n]* and [^\n]* have different addresses} "vect" } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-alias-check-7.c
===================================================================
--- /dev/null	2017-08-09 18:16:39.535015779 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-alias-check-7.c	2017-08-10 14:36:24.201888108 +0100
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#define N 16
+
+struct s { int x[N]; };
+
+void
+f1 (struct s *a, struct s *b)
+{
+  for (int i = 0; i < N; ++i)
+    a->x[i] += b->x[N - i - 1];
+}
+
+/* { dg-final { scan-tree-dump {checking that [^\n]* and [^\n]* have different addresses} "vect" } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_perm && vect_element_align } } } } */

             reply	other threads:[~2017-08-10 13:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 13:42 Richard Sandiford [this message]
2017-08-10 19:06 ` Richard Biener

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=87y3qrv8zw.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).