From patchwork Mon Oct 23 17:31:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116822 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4895594qgn; Mon, 23 Oct 2017 10:31:44 -0700 (PDT) X-Received: by 10.99.114.29 with SMTP id n29mr12354760pgc.303.1508779904730; Mon, 23 Oct 2017 10:31:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508779904; cv=none; d=google.com; s=arc-20160816; b=EqW5J2PHgcIWFKgbN62EfNfeoVEXqzfLjsxg7D0PKoRPPP94BW8zACVoavv/jHaRcn Us0z6gogimsgpX1EeO/Y0RxogYTgQ4lDtxGcWLCK2ag2z3KsKnC2r621he9qsKbnVBYq OHhlybFR2X5glILSA02//SIzQTtkI9XY13MA9hd0o3poUzm206USHeyJAQ6q9DlxOdYU 7ijdTr5N4XYnWXa5SNQy2WJvzE5TBq3lnlao3cUs2Y3y56mRXrW0pg9LaHsa0gmAlGnN cL/LTF+ca5d4YCyxySLjR7CyqrtWy6UjZ2C03W2gxPAmRDSMBP3vK6V5qVwep8xI3AAX t2cQ== 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=hAYtyr1nqVg0T34pmbemQlupzdgVB9bbaqIvldG23rM=; b=i/czAsPqQgE8OnfTVCfLHctnbsW9y567VionC4orfFlsNsOE05n2EiP8lVc6t0kU+q xVuWdy48cdB1gWUMNkQ1l+Dg82Ag9f+ISJaY2XXpX8oFRd4/ebf2xzqwo42DTyGpcodE V9nVhVrwGNWe1Ot48q/7dzVSNyYrweyIfjbZ/U9wTXIVgT/8v+zoa9B7X1CbbL85wUaj zV05eugI6pDWZYyvqtzm2sXmVG8Z/GIhu6mpld9ng2cu/A/jZCUK4GwPFruHqkG2KEi9 cjFiC8WtagaN4rJ3iCRiKM2o1UEIRA7lmdUqr//ptxYArNjiWkHJu+RYRbFqLyP2ZxT7 kJcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=PM7e/Qsz; spf=pass (google.com: domain of gcc-patches-return-464853-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464853-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 a8si4270023plm.56.2017.10.23.10.31.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 10:31:44 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464853-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=PM7e/Qsz; spf=pass (google.com: domain of gcc-patches-return-464853-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464853-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=Tu5gYN533EnsXD1wLmGDZFVZ7MQ7q gCXtI5gfOQUIC5zWU2DfgUoJOmHMYNP+FtdDXbEg12AEH3B7OJx+2wR8ndSmDMAd 9nFRnOIRYnsPX7uey90j2Tfz7dtlaohmH27MU6rpXdIMlGGKeZ3gQRXZzjsf0Etm Kmi5aBrUfcCMzw= 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=3e9+I3/kzyjwPcwqBSkhc9yembE=; b=PM7 e/QszJ7GA+hnjLZXsZ4EsObdWOqwCxIRie4ZyCAlGwiNUHpFZKjcUfEhdwlEB9K9 ziKNsXJLRKC/YOel1Y4qShB14mOShlr6ojAQ4QepCGdjcxXyJzU+hozO0Pn02K9h F0xJW1QEtmKM/Nyp6Io1Wj2Swc6h+me1yccLu4Ok= Received: (qmail 15136 invoked by alias); 23 Oct 2017 17:31:31 -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 14341 invoked by uid 89); 23 Oct 2017 17:31:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=40320 X-HELO: mail-wr0-f171.google.com Received: from mail-wr0-f171.google.com (HELO mail-wr0-f171.google.com) (209.85.128.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:31:29 +0000 Received: by mail-wr0-f171.google.com with SMTP id y39so18203118wrd.4 for ; Mon, 23 Oct 2017 10:31:29 -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=hAYtyr1nqVg0T34pmbemQlupzdgVB9bbaqIvldG23rM=; b=mUwVmkuLrMCsb2FZiyrBi/9zLkggOh9UuA20lIsjrt54vfzWgeazJYd7ezDTcgvdNl 9S466V4CQz/kqgNT9PfJLWUiR0zTO6r4RHa5remPUz50HU+6Z/+RDCitVSoEsL9/t+ez a85nsTEPUQGqfqoQnuWnUaqOSTIl7D3jmnYCh+mqL/rB/rN8boVnR5dW/PcRBtMMCw0M vmapy/qzw+Q/a+emubSRidBrx0+6H2FL0aZM4APmnm3spRcxSuJXiAhu8FPa9HWo4MDV PiXjYEvkOnHOQZMHIu674CWwS8Eweo0jh0wxfI0PcqYBVnFTCPhsnA99yZyHV4dtMJbl K2/A== X-Gm-Message-State: AMCzsaWl6IU9VCP4aP7ZoDqNmJtkBYirXNy7DLh51pKaoAHarCdonpmC crHoOovZrdazVU2/i5TIaQ0I9JkwPTE= X-Google-Smtp-Source: ABhQp+QMTJHzMscHJLQsOnpjnfOC7Q3TCbUt25JF12p6+BVinbXtMMQP/EMdXOCR7ufekpzccH1QiA== X-Received: by 10.223.131.166 with SMTP id 35mr12004396wre.84.1508779887136; Mon, 23 Oct 2017 10:31:27 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id r63sm9569731wmg.13.2017.10.23.10.31.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:31:26 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [077/nnn] poly_int: vect_get_constant_vectors References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 18:31:25 +0100 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87mv4hhitu.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 For now, vect_get_constant_vectors can only cope with constant-length vectors, although a patch after the main SVE submission relaxes this. This patch adds an appropriate guard for variable-length vectors. The TYPE_VECTOR_SUBPARTS use in vect_get_constant_vectors will then have a to_constant call when TYPE_VECTOR_SUBPARTS becomes a poly_int. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject constant and extern definitions for variable-length vectors. (vect_get_constant_vectors): Note that the number of units is known to be constant. Index: gcc/tree-vect-slp.c =================================================================== --- gcc/tree-vect-slp.c 2017-10-23 17:22:32.728227020 +0100 +++ gcc/tree-vect-slp.c 2017-10-23 17:22:42.827179461 +0100 @@ -403,6 +403,20 @@ vect_get_and_check_slp_defs (vec_info *v { case vect_constant_def: case vect_external_def: + /* We must already have set a vector size by now. */ + gcc_checking_assert (maybe_nonzero (current_vector_size)); + if (!current_vector_size.is_constant ()) + { + if (dump_enabled_p ()) + { + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + "Build SLP failed: invalid type of def " + "for variable-length SLP "); + dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, oprnd); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); + } + return -1; + } break; case vect_reduction_def: @@ -3219,6 +3233,7 @@ vect_get_constant_vectors (tree op, slp_ = build_same_sized_truth_vector_type (STMT_VINFO_VECTYPE (stmt_vinfo)); else vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); + /* Enforced by vect_get_and_check_slp_defs. */ nunits = TYPE_VECTOR_SUBPARTS (vector_type); if (STMT_VINFO_DATA_REF (stmt_vinfo))