public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org
Subject: Re: [1/10] Consistently use asm volatile ("" ::: "memory") in vect tests
Date: Wed, 08 Nov 2017 19:10:00 -0000	[thread overview]
Message-ID: <570a6c15-ae8b-44ff-2232-81c913cb2963@redhat.com> (raw)
In-Reply-To: <87efpfqqx5.fsf@linaro.org>

On 11/03/2017 10:15 AM, Richard Sandiford wrote:
> The vectoriser tests used a combination of:
> 
> 1) if (impossible condition) abort ();
> 2) volatile int x; ... *x = ...;
> 3) asm volatile ("" ::: "memory");
> 
> to prevent vectorisation of a set-up loop.  The problem with 1) is that
> the compiler can often tell that the condition is false and optimise
> it away before vectorisation.
> 
> This was already happening in slp-perm-9.c, which is why the test was
> expecting one loop to be vectorised even when the required permutes
> weren't supported.  It becomes a bigger problem with SVE, which is
> able to vectorise more set-up loops.
> 
> The point of this patch is therefore to replace 1) with something else.
> 2) should work most of the time, but we don't usually treat non-volatile
> accesses as aliasing unrelated volatile accesses, so I think in principle
> we could split the loop into one that does the set-up and one that does
> the volatile accesses.  3) seems more robust because it's also a wild
> read and write.
> 
> The patch therefore tries to replace all instances of 1) and 2) with 3).
> 
> 
> 2017-11-03  Richard Sandiford  <richard.sandiford@linaro.org>
> 	    Alan Hayward  <alan.hayward@arm.com>
> 	    David Sherwood  <david.sherwood@arm.com>
> 
> gcc/testsuite/
> 	* gcc.dg/vect/bb-slp-cond-1.c (main): Add an asm volatile
> 	to the set-up loop.
> 	* gcc.dg/vect/slp-perm-7.c (main): Prevent vectorisation with
> 	asm volatile ("" ::: "memory") instead of a conditional abort.
> 	Update the expected vector loop count accordingly.
> 	* gcc.dg/vect/slp-perm-9.c (main): Likewise.
> 	* gcc.dg/vect/bb-slp-1.c (main1): Prevent vectorisation with
> 	asm volatile ("" ::: "memory") instead of a conditional abort.
> 	* gcc.dg/vect/slp-23.c (main): Likewise,
> 	* gcc.dg/vect/slp-35.c (main): Likewise,
> 	* gcc.dg/vect/slp-37.c (main): Likewise,
> 	* gcc.dg/vect/slp-perm-4.c (main): Likewise.
> 	* gcc.dg/vect/bb-slp-24.c (foo): Likewise.  Remove dummy argument.
> 	(main): Update call accordingly.
> 	* gcc.dg/vect/bb-slp-25.c (foo, main): As for bb-slp-24.c.
> 	* gcc.dg/vect/bb-slp-26.c (foo, main): Likewise.
> 	* gcc.dg/vect/bb-slp-29.c (foo, main): Likewise.
> 	* gcc.dg/vect/no-vfa-vect-102.c (foo): Delete.
> 	(main): Don't initialize it.
> 	(main1): Prevent vectorisation with asm volatile ("" ::: "memory")
> 	instead of a conditional abort.
> 	* gcc.dg/vect/no-vfa-vect-102a.c (foo, main1, main): As for
> 	no-vfa-vect-102.c
> 	* gcc.dg/vect/vect-103.c (foo, main1, main): Likewise.
> 	* gcc.dg/vect/vect-104.c (foo, main1, main): Likewise.
> 	* gcc.dg/vect/pr42709.c (main1): Remove dummy argument.
> 	Prevent vectorisation with asm volatile ("" ::: "memory")
> 	instead of a conditional abort.
> 	* gcc.dg/vect/slp-13-big-array.c (y): Delete.
> 	(main1): Prevent vectorisation with asm volatile ("" ::: "memory")
> 	instead of a conditional abort.
> 	* gcc.dg/vect/slp-3-big-array.c (y, main1): As for slp-13-big-array.c.
> 	* gcc.dg/vect/slp-34-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/slp-4-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/slp-multitypes-11-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-105.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-105-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-112-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-15-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-2-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-34-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-6-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-73-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-74-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-75-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-76-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-80-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-97-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-all-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-reduc-1char-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-reduc-2char-big-array.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-strided-a-mult.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-strided-a-u16-i2.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-strided-a-u16-i4.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-strided-a-u16-mult.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-strided-a-u8-i2-gap.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-strided-a-u8-i8-gap2-big-array.c (y, main1):
> 	Likewise.
> 	* gcc.dg/vect/vect-strided-a-u8-i8-gap2.c (y, main1): Likewise.
> 	* gcc.dg/vect/vect-strided-a-u8-i8-gap7-big-array.c (y, main1):
> 	Likewise.
> 	* gcc.dg/vect/vect-strided-a-u8-i8-gap7.c (y, main1): Likewise.
> 	* gcc.dg/vect/slp-24.c (y): Delete.
> 	(main): Prevent vectorisation with asm volatile ("" ::: "memory")
> 	instead of a conditional abort.
> 	* gcc.dg/vect/slp-24-big-array.c (y, main): As for slp-24.c.
> 	* gcc.dg/vect/vect-98-big-array.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-bswap16.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-bswap32.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-bswap64.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-mult-char-ls.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-mult.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-same-dr.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u16-i2.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u16-i4.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u32-i4.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u32-i8.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u8-i2-gap.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u8-i2.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u8-i8-gap2-big-array.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u8-i8-gap2.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u8-i8-gap4-big-array.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u8-i8-gap4.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u8-i8-gap7-big-array.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u8-i8-gap7.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-strided-u8-i8.c (y, main): Likewise.
> 	* gcc.dg/vect/vect-10-big-array.c (y): Delete.
> 	(foo): Prevent vectorisation with asm volatile ("" ::: "memory")
> 	instead of a conditional abort.
> 	* gcc.dg/vect/vect-double-reduc-6-big-array.c (y, foo): As for
> 	vect-10-big-array.c.
> 	* gcc.dg/vect/vect-reduc-pattern-1b-big-array.c (y, foo): Likewise.
> 	* gcc.dg/vect/vect-reduc-pattern-1c-big-array.c (y, foo): Likewise.
> 	* gcc.dg/vect/vect-reduc-pattern-2b-big-array.c (y, foo): Likewise.
> 	* gcc.dg/vect/vect-117.c (foo): Delete.
> 	(main): Don't initalize it.
OK.
jeff

  reply	other threads:[~2017-11-08 19:07 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 [this message]
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 ` [7/10] Add a vect_unaligned_possible " Richard Sandiford
2017-11-08 22:32   ` Jeff Law
2017-11-03 16:21 ` [8/10] Add a vect_variable_length " Richard Sandiford
2017-11-08 22:33   ` 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=570a6c15-ae8b-44ff-2232-81c913cb2963@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@linaro.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).