From patchwork Thu Aug 10 13:37:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 109809 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2373931qge; Thu, 10 Aug 2017 06:38:17 -0700 (PDT) X-Received: by 10.84.132.46 with SMTP id 43mr13204266ple.409.1502372297385; Thu, 10 Aug 2017 06:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502372297; cv=none; d=google.com; s=arc-20160816; b=Fb2DQOQ65hJo+RCWm0y69XL9bd+Kh7FUEoCVVaPlwNb0zi27n9bIY6sBoeAJuy0VIm tEeQoYObn412YpMjn5R5Xm8C/rkPEKpgFsHbh1QMF2m3zyYbVae6++wnM3iyZqk4xyc1 xqseJxLN0oOB7q/PLsBbU4WtW8P9UmdScoL9WgII1rdm/J6yd/KlwrQekwk16KugEc+Y 7IEXokP+8TECjnAb3q0kzX4I+PqWX8cBnSdW2X1qNYNwEjAt2lOVRe9XAiFIn+RyZ3mB qtPOjXdyRe/eOVE0Gh29ZwM10pgDJrDr/lxcVj+vkNYZOxDwG7+n5JwcDCwkCN0PIyyh ITyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:date: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=SEmzoRk9xe0VMgecBhh+Wzd9/OTNion0nmMIKaARzZs=; b=SLtD40rRrwtYk2NSlnggCruoQEdqO3/GNlVjvDWmCCBjcrlyffphewpqRmAUE4eTOU FB+yV6nwt1z8Xd0e55WnzLDnDWpMNPR96cNteiEPbxdS4ENvDZuSCx3P8pYJxbN1LV5o Kc230+r0W5/Pi/837+ghbPlLwLth9ukeREZFfQanDii7a3LHxpcpmw0QB17euC0JJF3L J9yq/CxkDPey8BgDldIRBcH6InkfNrj1kXzT8wFDIzdjiVzfJGRfOtGas5LTP7wGc/Ca k06OF1UzcWwrlA3uKHZwUesf5gSRozoVO6CX9c6kPk1tfCbR1gKk1L47+msSM2oPZIIn wMsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=umuOa41F; spf=pass (google.com: domain of gcc-patches-return-460178-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-460178-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 67si4120657pfv.603.2017.08.10.06.38.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Aug 2017 06:38:17 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-460178-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=umuOa41F; spf=pass (google.com: domain of gcc-patches-return-460178-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-460178-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:date:message-id:mime-version:content-type; q=dns; s= default; b=niOrWLJSTGDNTTDfLEZAANNluXG5vBmlLOMqOdy9cuB8z0tbdALEv 8lr3Un2npGUUFDT3PG3fSrMgrkM2wHuOuduOfqAILhr2IkG2yowQnerOIgT6Xaxg GHT6WZRnjMqEkX7GJvDF6e+zgcKlQ7fp/vEqjqhD2eTW6V2rGTpCks= 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:date:message-id:mime-version:content-type; s= default; bh=vao/NcTNfQjATnyo2OSNGzTh7ik=; b=umuOa41FO5LnmxnIVXvj q7EtVXDDOxPX1B3sy7m2QZCh8kkVqzqC18+nyzk61rHTLIlKOWnJSpCXEj30HYaM RWSwyr7XFmKstx/s3GUHuUMqzY47DMgg4btlsUfwK/nZEV6PLLc73YOpcyT/JY8Z r6S/b6ks+Zr2B+fkIFPQbqw= Received: (qmail 57285 invoked by alias); 10 Aug 2017 13:38:02 -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 57218 invoked by uid 89); 10 Aug 2017 13:38:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=unaffected, H*p:D*org X-HELO: mail-wr0-f172.google.com Received: from mail-wr0-f172.google.com (HELO mail-wr0-f172.google.com) (209.85.128.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Aug 2017 13:37:59 +0000 Received: by mail-wr0-f172.google.com with SMTP id f21so3088601wrf.5 for ; Thu, 10 Aug 2017 06:37:58 -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:date:message-id :user-agent:mime-version; bh=SEmzoRk9xe0VMgecBhh+Wzd9/OTNion0nmMIKaARzZs=; b=XmLh8x2pMC3eFOxuqcVRR57VkUyaSLWvpapQqnAyEz0Op6eZnv9b1+hGXtQfeVjbkP nR/JCvWIBzTDqDhoOKDPjWS4ph75beNz6S+f5wQWHgIaHTqJ6nLvKK+lFpGxF73asq9c Nkp5T2AsgXfr9c1xIpCquxHCYLH7whqnayOSpJnKJF9rtjCpE6Y+v4QNutdzxAKKHA6O 4cUIJBOOfBYq2WSpx8AMFTigj5rgQv0rwY86BeH3w0SmsWTO+kEQiuoaF5y9AitSnlcV HIVtTcTQ7uEDdmhU+yYjzDgMU1ws+ApwXqq55WMqYdKPDb5xcOdXmG+dnkEirjzGoSyy A0dw== X-Gm-Message-State: AHYfb5hJprGnw7FhzCZT1c04rsXN4tMBt2cXrrTxjWDCR+mdwQHELvvD vCNxBjQ65x1D/Z59BWJ4Lw== X-Received: by 10.223.160.68 with SMTP id l4mr8038807wrl.162.1502372277076; Thu, 10 Aug 2017 06:37:57 -0700 (PDT) Received: from localhost ([2.26.27.176]) by smtp.gmail.com with ESMTPSA id n22sm4414695wra.30.2017.08.10.06.37.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Aug 2017 06:37:56 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: PR81738: Split vect-alias-check-6.c Date: Thu, 10 Aug 2017 14:37:55 +0100 Message-ID: <87y3qrv8zw.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 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 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 } } } } */