From patchwork Fri Nov 3 16:15:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 117937 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3650547qgn; Fri, 3 Nov 2017 09:16:25 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SrLX81/+cjJEnYGV2JUNXh11aFQ0a6ubC9vv1ElO/P+zTFdkoV5BMbysrl1xgtmWpktYNb X-Received: by 10.84.235.134 with SMTP id p6mr7474320plk.326.1509725785782; Fri, 03 Nov 2017 09:16:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509725785; cv=none; d=google.com; s=arc-20160816; b=jaz4wR30vA4x8LKgvms4PnqyFE7P87jIYlL9dvz+JvjiiHzP8ijuxvdQbsNQO4cFnF +DLYsoq20ot5BIpTC/K+/GsYXRMRsJ7Y32EILYoOb2vDVjuJW+KAckb/qc9picf+w5r4 zZFdqP/3YOePwqR3Cv/g2DCOy2ggL0ncLbvyIa5i61nl147NAZCJ+GoVh9hPIFmUWzBe cuAPNyXyPUBUR4oErb5z5dtyCTtk8YblO4ReD/gZy94ZZeiVOrUMrC42uKEOZX04h9SY vppweXUDVwpe2lHeXpNJ4sSAeVN/c18RPC4wYkQbluBH74vIhiDk3BW/nZVuNPDjB43s j/Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=/MNEtEnAtBimHata7NqPSShlZpXkeoB1qSKKpVpUy28=; b=VebXtLmbz1lafyh1TmsbwXSkfXsuF+i7wB56Y9FIPykAbJNYVwR4kBWsOrwSINnty9 yHJL2e6KdXk7JERSn9w0sHlIXjU+kLTdrq24xQEmNr+0WyweQUCWiRrxrJAx/1PXzihe FGJZjpqspF87LA8RdBE1qwJDwLVAgg1v5X1q2PMOQs80IYl2oPFKJyghwcSz4gazIW1a 7/4GPBTkItF8gIY0MDKPD/ySiv7cA3TkpIXciDLvcR+LQoRuoLUzd8pHUUsX/yh8NWCG hg6T2pwsrHPpIjqsMmmMdxIORTHm8tUGMf51pz2g4CpXQJI7lQnwVZZR39GSsnS2/AMO /P8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=u4dz0njL; spf=pass (google.com: domain of gcc-patches-return-465869-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465869-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c23si5381315plo.446.2017.11.03.09.16.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:16:25 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465869-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=u4dz0njL; spf=pass (google.com: domain of gcc-patches-return-465869-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465869-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=NPLk0Nm/IMWRmRPfd0AKERNsQ9+JZ B8Ty8yuASABmZJm0cFNIfw+hftd5PxobTaZLCmYovq8wdnaegQk0jNH1y6b6E3d/ Z1GCp0rx50o/hJcnSk6Lv7+4kqubaO1EAk50B9jgAANC31cXbP1NKqp+4M6XDEVR woro/5R1lr7Vh8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=tW6bTtVLBCuRmhfnY8+k1/RxHHM=; b=u4d z0njLbffYGMCZ0i8uDLzFfd67H4EODcYeph4XR7+0JpbbPqMq6DQ1HeZkkxJwY5N bgKsdX+f0uY0h0IwsXf6bU/h/qSmQgUednC69Xv3EZ1WrYz1MSRMLiX2EQgNdIIh T/xUw43qEJZMca54tVpDeAy1eFuSwvEJ6/GJ4vgY= Received: (qmail 74590 invoked by alias); 3 Nov 2017 16:16:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 70789 invoked by uid 89); 3 Nov 2017 16:16:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:no-vfa-, sk:novfa, UD:vect-strided-a-u8-i2-gap.c, UD:vect-117.c X-HELO: mail-wr0-f177.google.com Received: from mail-wr0-f177.google.com (HELO mail-wr0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:15:57 +0000 Received: by mail-wr0-f177.google.com with SMTP id j15so2958279wre.8 for ; Fri, 03 Nov 2017 09:15:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=/MNEtEnAtBimHata7NqPSShlZpXkeoB1qSKKpVpUy28=; b=t8JJ0u+HaWm7p57hbZFZ9Zcnrxh4tjiuLfc/yLebe7QZvr746L14rmN3j2sbISJmxJ BWTyoDF3RqKgZxTWvQEjexEJcJG84gGNKWAGS/Ayr1XuFjPEKC9gg36L4NwJ3izCuBAI EG2O9TxFk1xGwRV0CazJB+Tb6ijf01HAM9nXxvhi7n23YMwEs8z56bossTaB0XjenCdB JZ+TM7RGGYIUxRDtl+xGxl5IRLcDRZWOmF8CJ2zjfKVy2Vv/AQH0YmVseVfS7Fym4kn9 0LoNPbCqzS1gg9H2o03Wat+3OXxWsW9V2V8sRFNtdRXMLL4Aocz9hr+/zV36LIZo4ep/ chVQ== X-Gm-Message-State: AMCzsaXFUNBFECemknQ5N1/CkCUTjxFCYHZG50KvfNx+MmhdSJ89ab6t XqGqEKbC1Q9ET7o6B5kXpJnPexk0tF4= X-Received: by 10.223.172.106 with SMTP id v97mr6905464wrc.229.1509725753952; Fri, 03 Nov 2017 09:15:53 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id 71sm4363427wmg.0.2017.11.03.09.15.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:15:53 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [1/10] Consistently use asm volatile ("" ::: "memory") in vect tests References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:15:50 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <87efpfqqx5.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 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. Index: gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c 2017-02-23 19:54:09.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c 2017-11-03 16:06:03.052282173 +0000 @@ -28,7 +28,10 @@ int main () check_vect (); for (i = 0; i < N; i++) - a[i] = i; + { + a[i] = i; + asm volatile ("" ::: "memory"); + } foo (a, 4); Index: gcc/testsuite/gcc.dg/vect/slp-perm-7.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-7.c 2016-01-13 13:48:42.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-7.c 2017-11-03 16:06:03.053282336 +0000 @@ -57,8 +57,7 @@ int main (int argc, const char* argv[]) input2[i] = i%256; output[i] = 0; output2[i] = 0; - if (input[i] > 200) - abort (); + asm volatile ("" ::: "memory"); } foo (input, output, input2, output2); @@ -70,7 +69,7 @@ int main (int argc, const char* argv[]) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm && {! vect_load_lanes } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target vect_load_lanes } } } */ /* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm && vect_load_lanes } } } } */ Index: gcc/testsuite/gcc.dg/vect/slp-perm-9.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-9.c 2017-10-09 11:50:52.047711098 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-perm-9.c 2017-11-03 16:06:03.054282499 +0000 @@ -33,8 +33,7 @@ int main (int argc, const char* argv[]) { input[i] = i; output[i] = 0; - if (input[i] > 256) - abort (); + asm volatile ("" ::: "memory"); } for (i = 0; i < N / 3; i++) @@ -54,8 +53,8 @@ int main (int argc, const char* argv[]) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { {! vect_perm } || {! vect_sizes_16B_8B } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { { vect_perm } && { vect_sizes_16B_8B } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" { target { {! vect_perm } || {! vect_sizes_16B_8B } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_perm } && { vect_sizes_16B_8B } } } } } */ /* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm_short } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */ Index: gcc/testsuite/gcc.dg/vect/bb-slp-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-1.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-1.c 2017-11-03 16:06:03.051282010 +0000 @@ -25,9 +25,7 @@ main1 (int dummy) *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; - /* Avoid loop vectorization. */ - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } /* check results: */ Index: gcc/testsuite/gcc.dg/vect/slp-23.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-23.c 2015-06-13 10:48:20.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-23.c 2017-11-03 16:06:03.052282173 +0000 @@ -97,8 +97,7 @@ int main (void) arr[i].f = i * 5; arr[i].g = i - 3; arr[i].h = 56; - if (arr[i].a == 178) - abort(); + asm volatile ("" ::: "memory"); } main1 (arr); Index: gcc/testsuite/gcc.dg/vect/slp-35.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-35.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-35.c 2017-11-03 16:06:03.053282336 +0000 @@ -58,8 +58,7 @@ int main (void) arr[i].c = 17; arr[i].d = i+34; arr[i].e = i * 3 + 5; - if (arr[i].a == 178) - abort(); + asm volatile ("" ::: "memory"); } main1 (arr); Index: gcc/testsuite/gcc.dg/vect/slp-37.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-37.c 2016-01-13 13:48:42.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-37.c 2017-11-03 16:06:03.053282336 +0000 @@ -49,9 +49,7 @@ int main (void) arr1[i].a = i; arr1[i].b = i * 2; arr1[i].c = (void *)arr1; - - if (arr1[i].a == 178) - abort(); + asm volatile ("" ::: "memory"); } Index: gcc/testsuite/gcc.dg/vect/slp-perm-4.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-4.c 2015-12-18 10:17:16.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-4.c 2017-11-03 16:06:03.053282336 +0000 @@ -68,10 +68,8 @@ int main (int argc, const char* argv[]) for (i = 0; i < N; i++) { input[i] = i%256; - if (input[i] > 200) - abort(); output[i] = 0; - __asm__ volatile (""); + asm volatile ("" ::: "memory"); } foo (input, output); Index: gcc/testsuite/gcc.dg/vect/bb-slp-24.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-24.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-24.c 2017-11-03 16:06:03.051282010 +0000 @@ -9,7 +9,7 @@ #define N 256 short src[N], dst[N]; void foo (short * __restrict__ dst, short * __restrict__ src, int h, - int stride, int dummy) + int stride) { int i; h /= 8; @@ -25,8 +25,7 @@ void foo (short * __restrict__ dst, shor dst[7] += A*src[7]; dst += stride; src += stride; - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } } @@ -43,7 +42,7 @@ int main (void) src[i] = i; } - foo (dst, src, N, 8, 0); + foo (dst, src, N, 8); for (i = 0; i < N; i++) { Index: gcc/testsuite/gcc.dg/vect/bb-slp-25.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-25.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-25.c 2017-11-03 16:06:03.051282010 +0000 @@ -9,7 +9,8 @@ #define N 256 short src[N], dst[N]; -void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy) +void foo (short * __restrict__ dst, short * __restrict__ src, int h, + int stride) { int i; h /= 16; @@ -25,8 +26,7 @@ void foo (short * __restrict__ dst, shor dst[7] += A*src[7] + src[7+stride]; dst += 8; src += 8; - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } } @@ -43,7 +43,7 @@ int main (void) src[i] = i; } - foo (dst, src, N, 8, 0); + foo (dst, src, N, 8); for (i = 0; i < N/2; i++) { Index: gcc/testsuite/gcc.dg/vect/bb-slp-26.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-26.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-26.c 2017-11-03 16:06:03.052282173 +0000 @@ -10,8 +10,7 @@ #define N 256 char src[N], dst[N]; void __attribute__((noinline,noclone)) -foo (char * __restrict__ dst, char * __restrict__ src, int h, - int stride, int dummy) +foo (char * __restrict__ dst, char * __restrict__ src, int h, int stride) { int i; h /= 16; @@ -27,8 +26,7 @@ foo (char * __restrict__ dst, char * __r dst[7] += A*src[7] + src[7+stride]; dst += 8; src += 8; - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } } @@ -45,7 +43,7 @@ int main (void) src[i] = i/8; } - foo (dst, src, N, 8, 0); + foo (dst, src, N, 8); for (i = 0; i < N/2; i++) { Index: gcc/testsuite/gcc.dg/vect/bb-slp-29.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-29.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-29.c 2017-11-03 16:06:03.052282173 +0000 @@ -9,7 +9,8 @@ #define N 256 short src[N], dst[N]; -void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy) +void foo (short * __restrict__ dst, short * __restrict__ src, int h, + int stride) { int i; h /= 16; @@ -25,8 +26,7 @@ void foo (short * __restrict__ dst, shor dst[7] = A*src[7] + B*src[8]; dst += stride; src += stride; - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } } @@ -43,7 +43,7 @@ int main (void) src[i] = i; } - foo (dst, src, N, 8, 0); + foo (dst, src, N, 8); for (i = 0; i < N/2; i++) { Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c 2017-11-03 16:06:03.052282173 +0000 @@ -14,7 +14,6 @@ struct extraction static int a[N] = {1,2,3,4,5,6,7,8,9}; static int b[N] = {2,3,4,5,6,7,8,9,9}; -volatile int foo; __attribute__ ((noinline)) int main1 (int x, int y) { @@ -24,9 +23,8 @@ int main1 (int x, int y) { for (i = 0; i < N; i++) { - p->a[i] = a[i]; - if (foo == 135) - abort (); /* to avoid vectorization */ + p->a[i] = a[i]; + asm volatile ("" ::: "memory"); } /* Not vectorizable: distance 1. */ @@ -48,7 +46,6 @@ int main (void) { check_vect (); - foo = 0; return main1 (0, N); } Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c 2015-06-02 23:53:35.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c 2017-11-03 16:06:03.052282173 +0000 @@ -14,7 +14,6 @@ struct extraction static int a[N] = {1,2,3,4,5,6,7,8,9}; static int b[N] = {2,3,4,5,6,7,8,9,9}; -volatile int foo; __attribute__ ((noinline)) int main1 (int x, int y) { @@ -24,9 +23,8 @@ int main1 (int x, int y) { for (i = 0; i < N; i++) { - p->a[i] = a[i]; - if (foo == 135) - abort (); /* to avoid vectorization */ + p->a[i] = a[i]; + asm volatile ("" ::: "memory"); } /* Not vectorizable: distance 1. */ @@ -48,7 +46,6 @@ int main (void) { check_vect (); - foo = 0; return main1 (0, N); } Index: gcc/testsuite/gcc.dg/vect/vect-103.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-103.c 2017-05-31 13:03:54.441152727 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-103.c 2017-11-03 16:06:03.054282499 +0000 @@ -15,7 +15,6 @@ struct extraction static int a[N] = {1,2,3,4,5,6,7,8,9}; static int b[N] = {17,24,7,0,2,3,4,31,82}; static int c[N] = {9,17,24,7,0,2,3,4,31}; -volatile int foo; __attribute__ ((noinline)) int main1 (int x, int y) { @@ -25,10 +24,9 @@ int main1 (int x, int y) { for (i = 0; i < N; i++) { - p->a[i] = a[i]; - p->b[i] = b[i]; - if (foo == 135) - abort (); /* to avoid vectorization */ + p->a[i] = a[i]; + p->b[i] = b[i]; + asm volatile ("" ::: "memory"); } /* Vectorizable: distance > VF. */ @@ -50,7 +48,6 @@ int main (void) { check_vect (); - foo = 0; return main1 (0, N); } Index: gcc/testsuite/gcc.dg/vect/vect-104.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-104.c 2017-05-03 08:46:27.807861752 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-104.c 2017-11-03 16:06:03.054282499 +0000 @@ -16,7 +16,6 @@ struct extraction static int a[N][N] = {{1,2,3},{4,5,6},{7,8,9}}; static int b[N][N] = {{17,24,7},{0,2,3},{4,31,82}}; static int c[N][N] = {{1,2,3},{4,5,5},{5,5,5}}; -volatile int foo; __attribute__ ((noinline)) int main1 (int x) { @@ -30,8 +29,7 @@ int main1 (int x) { { p->a[i][j] = a[i][j]; p->b[i][j] = b[i][j]; - if (foo == 135) - abort (); /* to avoid vectorization */ + asm volatile ("" ::: "memory"); } } @@ -60,7 +58,6 @@ int main (void) { check_vect (); - foo = 0; return main1 (N); } Index: gcc/testsuite/gcc.dg/vect/pr42709.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr42709.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/pr42709.c 2017-11-03 16:06:03.052282173 +0000 @@ -9,7 +9,7 @@ #define N 128 int *res[N]; int -main1 (int *a, int *b, int *c, int *d, int dummy) +main1 (int *a, int *b, int *c, int *d) { int i; @@ -19,8 +19,7 @@ main1 (int *a, int *b, int *c, int *d, i res[i+1] = b + 16; res[i+2] = c + 16; res[i+3] = d + 16; - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } } Index: gcc/testsuite/gcc.dg/vect/slp-13-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-13-big-array.c 2017-06-08 08:51:43.124296047 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-13-big-array.c 2017-11-03 16:06:03.052282173 +0000 @@ -4,7 +4,6 @@ #include "tree-vect.h" #define N 64 -volatile int y = 0; int main1 () @@ -18,8 +17,7 @@ main1 () for (i = 0; i < N*8; i++) { in[i] = in2[i] = i; - if (y) /* Avoid vectorization. */ - abort (); + asm volatile ("" ::: "memory"); } /* Induction is SLPable. */ Index: gcc/testsuite/gcc.dg/vect/slp-3-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-3-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-3-big-array.c 2017-11-03 16:06:03.053282336 +0000 @@ -6,7 +6,6 @@ #define N 96 unsigned short in[N*8]; -volatile int y = 0; int main1 () @@ -17,8 +16,7 @@ main1 () for (i = 0; i < N*8; i++) { in[i] = i&63; - if (y) /* Avoid vectorization. */ - abort (); + asm volatile ("" ::: "memory"); } for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/slp-34-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-34-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-34-big-array.c 2017-11-03 16:06:03.053282336 +0000 @@ -7,7 +7,6 @@ #define N 64 unsigned short in[N*8]; unsigned short in2[N*8]; -volatile int y = 0; int main1 () @@ -19,8 +18,7 @@ main1 () for (i = 0; i < N*8; i++) { in[i] = in2[i] = i; - if (y) /* Avoid vectorization. */ - abort (); + asm volatile ("" ::: "memory"); } /* SLP with unrolling by 8. */ Index: gcc/testsuite/gcc.dg/vect/slp-4-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-4-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-4-big-array.c 2017-11-03 16:06:03.053282336 +0000 @@ -4,7 +4,6 @@ #include "tree-vect.h" #define N 128 -volatile int y = 0; int main1 () @@ -17,8 +16,7 @@ main1 () for (i = 0; i < N*8; i++) { in[i] = i; - if (y) /* Avoid vectorization. */ - abort (); + asm volatile ("" ::: "memory"); } for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/slp-multitypes-11-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-multitypes-11-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-multitypes-11-big-array.c 2017-11-03 16:06:03.053282336 +0000 @@ -13,7 +13,6 @@ struct s }; char in[N*3]; -volatile int y = 0; __attribute__ ((noinline)) int main1 () @@ -24,8 +23,7 @@ main1 () for (i = 0; i < N; i++) { in[i] = i&127; - if (y) /* Avoid vectorization. */ - abort (); + asm volatile ("" ::: "memory"); } for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/vect-105.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-105.c 2015-06-02 23:53:35.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-105.c 2017-11-03 16:06:03.054282499 +0000 @@ -16,8 +16,6 @@ static int a[N][N] = {{1,2,3,11},{4,5,6, static int b[N][N] = {{17,28,15,23},{0,2,3,24},{4,31,82,25},{29,31,432,256}}; static int c[N][N] = {{1,2,3,11},{4,9,13,34},{45,67,83,13},{34,45,67,83}}; -volatile int y; - __attribute__ ((noinline)) int main1 (int x) { int i,j; @@ -30,10 +28,7 @@ int main1 (int x) { { p->a[i][j] = a[i][j]; p->b[i][j] = b[i][j]; - /* Because Y is volatile, the compiler cannot move this check out - of the loop. */ - if (y) - abort (); /* to avoid vectorization */ + asm volatile ("" ::: "memory"); } } Index: gcc/testsuite/gcc.dg/vect/vect-105-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-105-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-105-big-array.c 2017-11-03 16:06:03.054282499 +0000 @@ -16,8 +16,6 @@ struct extraction static int b[N][N]; static int c[N][N]; -volatile int y; - __attribute__ ((noinline)) int main1 (int x) { int i,j, off; @@ -29,8 +27,7 @@ int main1 (int x) { { a[i][j] = (i*7 + j*17)%53; b[i][j] = (i*11+ j*13)%41; - if (y) - abort (); /* to avoid vectorization. */ + asm volatile ("" ::: "memory"); } } for (i = 0; i < N; i++) @@ -38,8 +35,7 @@ int main1 (int x) { for (j = 0; j < N; j++) { c[i][j] = a[i][j]; - if (y) - abort (); /* to avoid vectorization. */ + asm volatile ("" ::: "memory"); } } for (i = 1; i < N; i++) @@ -53,8 +49,7 @@ int main1 (int x) { *(&c[0][0]+x+i+j) = *(&b[0][0] + off - N*N); else *(&c[0][0]+x+i+j) = *(&a[0][0] + off); - if (y) - abort (); /* to avoid vectorization. */ + asm volatile ("" ::: "memory"); } } @@ -64,10 +59,7 @@ int main1 (int x) { { p->a[i][j] = a[i][j]; p->b[i][j] = b[i][j]; - /* Because Y is volatile, the compiler cannot move this check out - of the loop. */ - if (y) - abort (); /* to avoid vectorization. */ + asm volatile ("" ::: "memory"); } } Index: gcc/testsuite/gcc.dg/vect/vect-112-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-112-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-112-big-array.c 2017-11-03 16:06:03.054282499 +0000 @@ -8,8 +8,6 @@ #define N 128 char cb[N]; char cc[N]; -volatile int y = 0; - __attribute__ ((noinline)) int main1 (void) { @@ -20,9 +18,7 @@ main1 (void) cb[i] = i + 2; cc[i] = i + 1; check_diff += (cb[i] - cc[i]); - /* Avoid vectorization. */ - if (y) - abort (); + asm volatile ("" ::: "memory"); } /* Cross-iteration cycle. */ Index: gcc/testsuite/gcc.dg/vect/vect-15-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-15-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-15-big-array.c 2017-11-03 16:06:03.054282499 +0000 @@ -5,8 +5,6 @@ #define N 128 -volatile int y = 0; - __attribute__ ((noinline)) int main1 () { @@ -17,8 +15,7 @@ int main1 () for (i = 0; i