From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49378 invoked by alias); 23 Oct 2017 17:33:14 -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 49360 invoked by uid 89); 23 Oct 2017 17:33:13 -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= X-HELO: mail-wm0-f41.google.com Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:33:12 +0000 Received: by mail-wm0-f41.google.com with SMTP id 78so8484267wmb.1 for ; Mon, 23 Oct 2017 10:33:11 -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=JjtHgAdMJF2PVniyfyhsV2MfeH6fz1KigODKLMROq5s=; b=NRe49zU6KT9OBGjrQHwM0mlJ3k9UntaZHxFukA/XkE1Bdjbw7/B7j6KngMWA0eqPbJ IeMqipNCcchzjNnBBEYAsNQ/iIMXNDTDyRntjhp8PbosYKXida5h6BnsS2kUpeKqSSJL Vkx4JgYWyB+XameK412rWlF5wqwzuF+4rWmzVAYenlIQvGHyj8YJtrO1FMXEOg98WxEs 1jNnXaEb+HAkp3j1+5j24Cc65r9Ee+O26Lxdvw/DZOxZ8Is78Vsy7oNJl3dvOfZ4MhLQ W37zs6x52FB+jzHDUYqqlkIfRFkWA9kSL6/9imRkANHT0byrExbmYJUojzF+PoHXV5HU 6vAQ== X-Gm-Message-State: AMCzsaUNFQZrpXidN9KzQIZaBjKjYNs7lqdy5w8PbxPMjuOJ/vxMhs+2 za671ogWXPHpTMkMTkdczg2XnAvd+Xc= X-Google-Smtp-Source: ABhQp+T4P863M27Z+XB51cH3kF1R21AaGO2apSmicGndx6g5VL6cGPoSNU6yr0aUnuuFLlgt+UOQHA== X-Received: by 10.28.41.70 with SMTP id p67mr6269204wmp.110.1508779990141; Mon, 23 Oct 2017 10:33:10 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id h4sm3236030wre.13.2017.10.23.10.33.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:33:09 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [082/nnn] poly_int: omp-simd-clone.c References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 17:33:00 -0000 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <871slthiqz.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-10/txt/msg01583.txt.bz2 This patch adds a wrapper around TYPE_VECTOR_SUBPARTS for omp-simd-clone.c. Supporting SIMD clones for variable-length vectors is post GCC8 work. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * omp-simd-clone.c (simd_clone_subparts): New function. (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS. (ipa_simd_modify_function_body): Likewise. Index: gcc/omp-simd-clone.c =================================================================== --- gcc/omp-simd-clone.c 2017-08-30 12:19:19.716220030 +0100 +++ gcc/omp-simd-clone.c 2017-10-23 17:22:47.947648317 +0100 @@ -51,6 +51,15 @@ Software Foundation; either version 3, o #include "stringpool.h" #include "attribs.h" +/* Return the number of elements in vector type VECTYPE, which is associated + with a SIMD clone. At present these always have a constant length. */ + +static unsigned HOST_WIDE_INT +simd_clone_subparts (tree vectype) +{ + return TYPE_VECTOR_SUBPARTS (vectype); +} + /* Allocate a fresh `simd_clone' and return it. NARGS is the number of arguments to reserve space for. */ @@ -770,7 +779,7 @@ simd_clone_init_simd_arrays (struct cgra } continue; } - if (TYPE_VECTOR_SUBPARTS (TREE_TYPE (arg)) == node->simdclone->simdlen) + if (simd_clone_subparts (TREE_TYPE (arg)) == node->simdclone->simdlen) { tree ptype = build_pointer_type (TREE_TYPE (TREE_TYPE (array))); tree ptr = build_fold_addr_expr (array); @@ -781,7 +790,7 @@ simd_clone_init_simd_arrays (struct cgra } else { - unsigned int simdlen = TYPE_VECTOR_SUBPARTS (TREE_TYPE (arg)); + unsigned int simdlen = simd_clone_subparts (TREE_TYPE (arg)); tree ptype = build_pointer_type (TREE_TYPE (TREE_TYPE (array))); for (k = 0; k < node->simdclone->simdlen; k += simdlen) { @@ -927,8 +936,8 @@ ipa_simd_modify_function_body (struct cg iter, NULL_TREE, NULL_TREE); if (adjustments[j].op == IPA_PARM_OP_NONE - && TYPE_VECTOR_SUBPARTS (vectype) < node->simdclone->simdlen) - j += node->simdclone->simdlen / TYPE_VECTOR_SUBPARTS (vectype) - 1; + && simd_clone_subparts (vectype) < node->simdclone->simdlen) + j += node->simdclone->simdlen / simd_clone_subparts (vectype) - 1; } l = adjustments.length ();