From patchwork Fri Nov 3 16:21:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 117944 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3656415qgn; Fri, 3 Nov 2017 09:21:58 -0700 (PDT) X-Google-Smtp-Source: ABhQp+R/Yi+h3hWig8KJOWkkoky4fKh+QqwzyyqqqJicuLRz20ov32+SWq2hIWoBnLvDJat34/5m X-Received: by 10.84.241.207 with SMTP id t15mr7220776plm.158.1509726118772; Fri, 03 Nov 2017 09:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509726118; cv=none; d=google.com; s=arc-20160816; b=XAzH/QNyfXPOQmcMvLWkQbtHF06YzUZBqXw6vYu6MgiU02tsD1M17MqfdSNfTljpWK 5Bxf51HoPZ0LBUBBeqIIbdkf1+cureBLqWMMYr1ykRFBQHcwHqCWUdGPQQO5y7BdssOt 1GftiitxTW5xLguhb0lxqM0ySTcI56vTUmwG3oXoU8Xajqp+2dI9yiONzZwxWnkon5hA d7Skw4aAJlahXKhnFrWcNQGj2IsF6Akbz4Czbql/ffI0z4Oe3NL9gEkxNsRxFUYAWUxq XJtbCJg+3woSKvPL9VRhI1jjOdFE0Q0oMVrVcovQmgVDUJlHJx3wfWBVGiVm0zugr6Gs KiFg== 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=Lq0/l00aUFFPORA/bUGb7ZK72W4SWR2dtYBUapFOHyc=; b=pLcXPy0srCauhMEQHQjdEiCRPJbPTOOw0xRDG4ca1HcBQElumaVDF1aauCLsfotJcT k/h0kJvP+YoNqXdzTYJJJvdUm2HIZGoHWz4c9yxKcHjsCqe/glXO7tQTkyjtxKmVV6d2 1MW3D2F+z+0MYReOaMZYLOWdSFFT3XB3AJd6Qkw8dlkmi2F/A2P4cOCAxhy1OuAY7KFJ kBFJItPCyVmCYhlsVJGVnjmAaeLZHHTGUtG9LH6kCc9n44SuhS+YOfUj6UbYkMyJZUtW HH4WNUhsbjj2jaTFlHWlStKnN1eR6xoeBsXpPHCx+MAVtlCH1aRrtM1nzrQw2z2/b6bw jM9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gBgDKvUO; spf=pass (google.com: domain of gcc-patches-return-465879-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465879-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 x67si6712448pfi.166.2017.11.03.09.21.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465879-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=gBgDKvUO; spf=pass (google.com: domain of gcc-patches-return-465879-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465879-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=p4WmjNipxX7H737vfvYch51Uq4LJl zyBjrxRuA4OWphG+60IRrgygOVy0pT+IIEWoSqhoSZkx4l87YNs7/MkFl6OIqE6H g0gxYRFnXHLcPj4rogmpLQaWVAHh46kTVUqQ828n0SvT67PFa2MGVOtK7bpbheel pTJcq9/VymRy+g= 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=3zPW+AiTIV6WTEjaUR2TKJvD+tM=; b=gBg DKvUOyNyeUvpInq7t9jbjHptprPT/GPQav10nKLUJall0+Pp4rMgzS+0gV7jS6j1 h8prAdvOeZkgE+Cse+zRyzL7EPdhX6v0rzj9pDXXC9afFrx6w2U6/2WwGvn2J39y ypqMQhh8N5bBJb+FWfXJHTlMwB+NQFzMpJ9LKEcA= Received: (qmail 44123 invoked by alias); 3 Nov 2017 16:21:46 -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 44113 invoked by uid 89); 3 Nov 2017 16:21:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, 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=commoning, predictive, Executing X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:21:44 +0000 Received: by mail-wm0-f46.google.com with SMTP id t139so2681438wmt.1 for ; Fri, 03 Nov 2017 09:21:44 -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=Lq0/l00aUFFPORA/bUGb7ZK72W4SWR2dtYBUapFOHyc=; b=jyyYtYqoQGz8j8edod0T60py+jrPjXRFrkW4GrePoJH3DrQBaLRn8X0eiMLAz8WtK6 V0FKTIHB4SQBMCMyowyi0K8YLHl6yN6W5/Z+G3iXe8erLQdeumSisy/Nc6op6wojj31B YDNCWHwRSklVUSvht4zWOvYQweaGjovetXtm4Bjvqnrr/gJCuAo47ffOEQ0Uw+wRuKZE WrI9FvmfeXc5vKXpsRVDao1jyE4yKGA+uM5z5SvGhHCabKnDG3j9UmsUVkyLfr8djIpL jylJaI6v9Sw4eexHJl+EYwbq2pi15vYzMCj7JgNIfu8QMrwrBI2GGuHZxTaSgXMOQ+0g qMdw== X-Gm-Message-State: AJaThX7574b/DAfxF1gbXsvbcsE4z224XbUJdkIFlppXUSjZ6I1TEA9N wjVam9vOpXIT5vNzr40hrGp05rME4rw= X-Received: by 10.28.145.196 with SMTP id t187mr242102wmd.119.1509726102499; Fri, 03 Nov 2017 09:21:42 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id p200sm2242324wmd.9.2017.11.03.09.21.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:21:41 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [8/10] Add a vect_variable_length target selector References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:21:40 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <87inerpc2z.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch adds a target selector for variable-length vectors. Initially it's always false, but the SVE patch provides a case in which it's true. 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/ * doc/sourcebuild.texi (vect_variable_length): Document. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_vect_variable_length): New proc. * gcc.dg/vect/pr60482.c: XFAIL test for no epilog loop if vect_variable_length. * gcc.dg/vect/slp-reduc-6.c: XFAIL two-operation SLP if vect_variable_length. * gcc.dg/vect/vect-alias-check-5.c: XFAIL alias optimization if vect_variable_length. * gfortran.dg/vect/fast-math-mgrid-resid.f: XFAIL predictive commoning optimization if vect_variable_length. Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi 2017-11-03 16:06:26.237889385 +0000 +++ gcc/doc/sourcebuild.texi 2017-11-03 16:06:52.929591350 +0000 @@ -1486,6 +1486,9 @@ Target prefers vectors to have an alignm alignment, but also allows unaligned vector accesses in some circumstances. +@item vect_variable_length +Target has variable-length vectors. + @item vect_widen_sum_hi_to_si Target supports a vector widening summation of @code{short} operands into @code{int} results, or can promote (unpack) from @code{short} Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:26.241888136 +0000 +++ gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:52.930591737 +0000 @@ -6714,6 +6714,12 @@ proc check_effective_target_vect_multipl return [expr { [llength [available_vector_sizes]] > 1 }] } +# Return true if variable-length vectors are supported. + +proc check_effective_target_vect_variable_length { } { + return [expr { [lindex [available_vector_sizes] 0] == 0 }] +} + # Return 1 if the target supports vectors of 64 bits. proc check_effective_target_vect64 { } { Index: gcc/testsuite/gcc.dg/vect/pr60482.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr60482.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/pr60482.c 2017-11-03 16:06:52.929591350 +0000 @@ -16,4 +16,6 @@ foo (double *x, int n) return p; } -/* { dg-final { scan-tree-dump-not "epilog loop required" "vect" } } */ +/* Until fully-masked loops are supported, we always need an epilog + loop for variable-length vectors. */ +/* { dg-final { scan-tree-dump-not "epilog loop required" "vect" { xfail vect_variable_length } } } */ Index: gcc/testsuite/gcc.dg/vect/slp-reduc-6.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-reduc-6.c 2015-06-02 23:53:35.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-reduc-6.c 2017-11-03 16:06:52.929591350 +0000 @@ -44,5 +44,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_int_add || { ! { vect_unpack || vect_strided2 } } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "different interleaving chains in one node" 1 "vect" { target { ! vect_no_int_add } } } } */ +/* { dg-final { scan-tree-dump-times "different interleaving chains in one node" 1 "vect" { target { ! vect_no_int_add } xfail vect_variable_length } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-alias-check-5.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-alias-check-5.c 2017-08-04 11:39:37.910284386 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-alias-check-5.c 2017-11-03 16:06:52.929591350 +0000 @@ -15,5 +15,5 @@ f1 (struct s *a, struct s *b) } /* { dg-final { scan-tree-dump-times "consider run-time aliasing" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "improved number of alias checks from 1 to 0" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "improved number of alias checks from 1 to 0" 1 "vect" { xfail vect_variable_length } } } */ /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 1 "vect" } } */ Index: gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f 2017-10-04 16:25:39.620051123 +0100 +++ gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f 2017-11-03 16:06:52.929591350 +0000 @@ -42,5 +42,5 @@ C ! vectorized loop. If vector factor is 2, the vectorized loop can ! be predictive commoned, we check if predictive commoning PHI node ! is created with vector(2) type. -! { dg-final { scan-tree-dump "Executing predictive commoning without unrolling" "pcom" } } -! { dg-final { scan-tree-dump "vectp_u.*__lsm.* = PHI <.*vectp_u.*__lsm" "pcom" } } +! { dg-final { scan-tree-dump "Executing predictive commoning without unrolling" "pcom" { xfail vect_variable_length } } } +! { dg-final { scan-tree-dump "vectp_u.*__lsm.* = PHI <.*vectp_u.*__lsm" "pcom" { xfail vect_variable_length } } }