From patchwork Mon Oct 23 17:30:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116819 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4894727qgn; Mon, 23 Oct 2017 10:30:53 -0700 (PDT) X-Received: by 10.84.139.129 with SMTP id 1mr11008046plr.167.1508779853121; Mon, 23 Oct 2017 10:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508779853; cv=none; d=google.com; s=arc-20160816; b=CjycDRWPXA0BBFyb8xt3kdpVwmXcnOyGAW/Ybop81nD1bd3zNCbfoRYKJHG3yLNdbF nGqeBd/9pYvtTatA6Z5TEnr3XjFnqe87wjcJ49Os8ZYKZY2fYyXNVV5x6FH9hHvP7+Mo GEZHBFEYDGfY/ncuK0dXGN6ehzlwPOMB6jkWU+Vuax9b1CsNDUM9Fv5tAC6wo4E/xELD A4DelyxaFifDHJTAeCzAOES7EImG82Clib2z/ss2C4KvR3X/nR6UDl4vGeyaZhEB3h/r bgAZ3ouP9tD0mZ2YyxYXOfeEnEPTsbNHYUeyRS/eEYlgKnR9sPRG5j1ZygWtNu2yGoiJ 8E3w== 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=ebmasMXTCgmRUIoFUqq2GG8I0gPWANlQfn3f5hLtOG4=; b=Keimiv50buYoFPEbdzRJpTW2RBJk4P9JqrDsF9pVdVDAZanpVcs5MGGYtpVBPi73Ck /yqANJiDeg9dHOllvKC+u4MRsnND3612JV6Js9TRH6MnM+05lpX9/QnnJQHQEskjEnio ivybYACm+ujNP8uyJPbJoFWCkdNbGRZjS9wSkddpyZGw2gFTCG718hGQeeCFHpjjf0gB 7SjeRvSmERMMmJ0qQwTgdUMV2LZpTMLNSBtiZ/AxqksOMrvLO5L/ORKwnwePlZs3Y/Ei CX3e9Q8mkzckj08qxzHz7k9a9ZYam/USvsOtxQpYnK+TQOV5PYut4eolr5otHcEGZHU3 3A5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=RKV1CcKC; spf=pass (google.com: domain of gcc-patches-return-464850-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464850-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 v12si4198111plp.87.2017.10.23.10.30.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 10:30:53 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464850-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=RKV1CcKC; spf=pass (google.com: domain of gcc-patches-return-464850-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464850-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=Wn+BGjQAFoZ4jc8G0xRt74qTMy0y3 fdJsPHbBbNt97MEpa2gIN1zkNnhM/W1sT4dZneSAMKOyDLkWIsEKWsFk129Zgr85 hqegXvTBg7QnbIR3B2ubsxAhduovB1mdBUQ5w7cvkE5L1JWcqk7Tg3OPeTjky1pF 10ogc4yCN9AXYE= 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=22KpGu1MDf6D7VC4hgD+Sb7FdO8=; b=RKV 1CcKCGXKYsASbVPqwB7gKGEBO7VGbR4J0290AmiafcWwSjwVy5B4nXov35JK1kBJ xIK95MKTK2zZowoXngFwaLgWkot5YQrVbI9hh01OzheF7qRMdYlZhbzPG5+bw5aD ORn9w1pGPVz/j1ba0LcjguwPS8XQtBDHUXGEf6ls= Received: (qmail 107566 invoked by alias); 23 Oct 2017 17:30:23 -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 105247 invoked by uid 89); 23 Oct 2017 17:30:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 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=substantial X-HELO: mail-wr0-f169.google.com Received: from mail-wr0-f169.google.com (HELO mail-wr0-f169.google.com) (209.85.128.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:30:20 +0000 Received: by mail-wr0-f169.google.com with SMTP id 15so4354291wrb.5 for ; Mon, 23 Oct 2017 10:30:20 -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=ebmasMXTCgmRUIoFUqq2GG8I0gPWANlQfn3f5hLtOG4=; b=rLyapDomseDH4Arlozte/G7U4PUZF43QAQl/zkNvdNwTIjN4s9lRdbGlDv8ESiRRvX lp8UW5BrHZw7ROhyw/6TZDTnKwLC2Z+TENsZBromnxX+nvvuJrrqnFIIqT6/OPfayOhx Y10mKXREv+viDV1OlBdChmK7SIR7S+y4FgM5QB4CT6PMSiSJdgfzl0DPDN0d/cEmBQGc 2Z2Uldx82sNbjng+Hnkh0mHYy+yDKzvfw33QwbNE44GLTjd1gEYSsG9UYYhCJW9ZM803 djoWg28iCfshqtZ1aBePOVsvtheeLbtfZWXO8BKJq6cTnsgV4XHqGrHuRBOzMzW9gBI1 K3nA== X-Gm-Message-State: AMCzsaVYr9GePVCRTlNIShKlkgiXeVrO2eD7hwkYYuVCxoKvM1dW0n8o y92UsCzy9HZa0j7xHmQgchtp3ppAGcQ= X-Google-Smtp-Source: ABhQp+S/lO/CQIBpsTU7G+dZ4BKToeVmIQh3MFX2kufP/vCQXoeOqvq0v3OG8e7lkknR6uMfOQys5w== X-Received: by 10.223.163.143 with SMTP id l15mr828429wrb.149.1508779818183; Mon, 23 Oct 2017 10:30:18 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id z192sm5869063wmz.28.2017.10.23.10.30.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:30:17 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [074/nnn] poly_int: vectorizable_call References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 18:30:16 +0100 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87zi8hhivr.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch makes vectorizable_call handle variable-length vectors. The only substantial change is to use build_index_vector for IFN_GOMP_SIMD_LANE; this makes no functional difference for fixed-length vectors. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-vect-stmts.c (vectorizable_call): Treat the number of vectors as polynomial. Use build_index_vector for IFN_GOMP_SIMD_LANE. Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c 2017-10-23 17:22:38.938582823 +0100 +++ gcc/tree-vect-stmts.c 2017-10-23 17:22:39.943478586 +0100 @@ -2637,8 +2637,8 @@ vectorizable_call (gimple *gs, gimple_st tree vec_oprnd0 = NULL_TREE, vec_oprnd1 = NULL_TREE; stmt_vec_info stmt_info = vinfo_for_stmt (gs), prev_stmt_info; tree vectype_out, vectype_in; - int nunits_in; - int nunits_out; + poly_uint64 nunits_in; + poly_uint64 nunits_out; loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info); bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info); vec_info *vinfo = stmt_info->vinfo; @@ -2758,11 +2758,11 @@ vectorizable_call (gimple *gs, gimple_st /* FORNOW */ nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in); nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out); - if (nunits_in == nunits_out / 2) + if (must_eq (nunits_in * 2, nunits_out)) modifier = NARROW; - else if (nunits_out == nunits_in) + else if (must_eq (nunits_out, nunits_in)) modifier = NONE; - else if (nunits_out == nunits_in / 2) + else if (must_eq (nunits_out * 2, nunits_in)) modifier = WIDEN; else return false; @@ -2961,11 +2961,7 @@ vectorizable_call (gimple *gs, gimple_st if (gimple_call_internal_p (stmt) && gimple_call_internal_fn (stmt) == IFN_GOMP_SIMD_LANE) { - auto_vec v (nunits_out); - for (int k = 0; k < nunits_out; ++k) - v.quick_push (build_int_cst (unsigned_type_node, - j * nunits_out + k)); - tree cst = build_vector (vectype_out, v); + tree cst = build_index_vector (vectype_out, j * nunits_out, 1); tree new_var = vect_get_new_ssa_name (vectype_out, vect_simple_var, "cst_"); gimple *init_stmt = gimple_build_assign (new_var, cst);