From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21229 invoked by alias); 8 Nov 2017 19:07:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 21219 invoked by uid 89); 8 Nov 2017 19:07:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=H*M:2232 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Nov 2017 19:07:33 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E3FF6C04B31A; Wed, 8 Nov 2017 19:07:31 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-12.rdu2.redhat.com [10.10.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 142AA60634; Wed, 8 Nov 2017 19:07:30 +0000 (UTC) Subject: Re: [1/10] Consistently use asm volatile ("" ::: "memory") in vect tests To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org References: <87inerqqyz.fsf@linaro.org> <87efpfqqx5.fsf@linaro.org> From: Jeff Law Message-ID: <570a6c15-ae8b-44ff-2232-81c913cb2963@redhat.com> Date: Wed, 08 Nov 2017 19:10:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <87efpfqqx5.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00659.txt.bz2 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 > Alan Hayward > David Sherwood > > 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