From patchwork Sat Dec 9 23:09:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 121292 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1157224qgn; Sat, 9 Dec 2017 15:09:32 -0800 (PST) X-Google-Smtp-Source: AGs4zMZMNyiWCy2zQvvoDhXVfA/W5Cn5wxWZqJ2L5Pd2q9k0dSecvDbTANJadpUof/mCkxv0sqiJ X-Received: by 10.101.101.211 with SMTP id y19mr33982786pgv.191.1512860972448; Sat, 09 Dec 2017 15:09:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512860972; cv=none; d=google.com; s=arc-20160816; b=xuwZPvXa7E5FEWGcw7IIfWrBeWBqkn9lzKJGIbiDVUuyPcfZoOHCcIDCaiHQa3CACr DgvGmX4u4bMEzI5wQ6GOvGb/qf4Ugu/o5GyJYrM4QnhtaJekyLKj6drB2mERo5GM3+X1 d6tjSQInXsESPFreDztMBKCMjp9rvXs1GpR0CydIqhRkcQ+wjAlzeELAZHtOtBIzeMw9 ZKkP01kU1rKZEy0LDWrXjclu4FhSzVTnIqob0M3oA1G0cdHRUmbPdBbAMcHFBxshoElW 7ehMvMqPi4ipV7JCgJCPPh9+hnaRhhQG8A3QT289C5SYM620aHhbCEr893os+vrQv4M+ y5/Q== 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=kOiy3sBijV2cPEjID66c4w6VRfK0yGtxPUxXabtbvPE=; b=AHZOTzaug422/gq3vxqAkTBmkjEcyVsLPLCubnDlB9CiGz84NCm3Yph8671tuQxadi JaDZn/ZBa60XMobNC3HdS7bPRC+d2cG7ChKsH4HlvHZiF4u5FKgkuZKoQB8pipSDYZxL FTwjiyA7QiUpRoKzxUFhKd2Rs939wwahucDTmvZtie4QwtlXthGkVhKfDrwdCzEezkUh bGWyIOtdkxUuqvRSFqRrhj1HGyTlJ3Lg6rG0PLNZmH0S9nL1jj8WrBOCs38oyMjutml+ xZknbwLgBO1OORBS6KOuSxTJShwfpSwgtUsgtlvDKt5MuEbS3a04FWW6W1NFE01sJIqY Ws9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Xc77CHGJ; spf=pass (google.com: domain of gcc-patches-return-468852-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-468852-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 z13si8424531pfe.281.2017.12.09.15.09.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 15:09:32 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-468852-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=Xc77CHGJ; spf=pass (google.com: domain of gcc-patches-return-468852-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-468852-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=uR3sRJeV01Jpl3XiMMBbiS+yMUG+U 4vwm2nPoj9fcfFz6S4OhNh4ph7/hBXnAbn1cphEX3OuoVovcM+nIzEuimJnb631C ytzgYDDS52jA29PcW9ZdF2fJbCWVmMUZF1ghM1WBseSn0jndXFKJUa3F/YKWq5dK LLR37/AO7wyQZI= 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=epH33h0SiVDqUFY/fkW7P4pcEWM=; b=Xc7 7CHGJDYpDGPl/BoW+ADnZWUDF6N/E63naGHCTu0ydr5yla9axdVJwWPGlzQRkOIa 8L/d1yVIxDdF1uOI2mv9nEijr4c+U9QXY1IYbBEiGDimCULX8FIaJvbRkdbr8ZG+ 7Yj7NLFuDMatx0ZUMJbVOMOBnslBvmS4QUHAhTNM= Received: (qmail 75516 invoked by alias); 9 Dec 2017 23:09:21 -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 75506 invoked by uid 89); 9 Dec 2017 23:09:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 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=sk:vect_ge, fold_vec_perm X-HELO: mail-wm0-f51.google.com Received: from mail-wm0-f51.google.com (HELO mail-wm0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 09 Dec 2017 23:09:19 +0000 Received: by mail-wm0-f51.google.com with SMTP id g130so8732207wme.0 for ; Sat, 09 Dec 2017 15:09:19 -0800 (PST) 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=kOiy3sBijV2cPEjID66c4w6VRfK0yGtxPUxXabtbvPE=; b=LXhsjpqvYScI/amsc7pGiO6OmKXDp/kXwStE1V4l0z/3udzBHZtdwq5UerZfLkKTKc ImUjk24RVZWASE/3jTFW8+2JQAq7w4ItkehwEC0vBK69RaJ71EsU+Pb+B315guopEk2Q K/QbwuuNSw2enw7FnmvuqAS2nDgPs7SJWs6PYDjYsn+7IfanX3Kzrx1eu1VJ0CWpoPJy eDoUNf0eBiZFDIF2OYt4FGVy/XlM47vyEUPeCP/98DtNVqjXvKDE0D/m168YEXJ6y8kf ZPrqbhEjNoAv5cJEFEkC+zo98jKvs07rEpvjShTMdXswcIiLeluSyrxAGMFzZf0cVYNv JCmQ== X-Gm-Message-State: AKGB3mIC3rHqN0+13kJrdqCdGlKw7XbWg2+pjIv0HOmokiRrJi7Uo79G ywH1cqRBESYQ3y/0T6DZpGuiZn6UxLc= X-Received: by 10.28.183.132 with SMTP id h126mr7887255wmf.17.1512860957343; Sat, 09 Dec 2017 15:09:17 -0800 (PST) Received: from localhost ([2.25.234.120]) by smtp.gmail.com with ESMTPSA id f56sm15925056wra.75.2017.12.09.15.09.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Dec 2017 15:09:16 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [02/13] Pass vec_perm_indices by reference References: <87indfmrgt.fsf@linaro.org> Date: Sat, 09 Dec 2017 23:09:15 +0000 In-Reply-To: <87indfmrgt.fsf@linaro.org> (Richard Sandiford's message of "Sat, 09 Dec 2017 23:06:26 +0000") Message-ID: <87a7yrmrc4.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 This patch makes functions take vec_perm_indices by reference rather than value, since a later patch will turn vec_perm_indices into a class that would be more expensive to copy. 2017-12-06 Richard Sandiford gcc/ * fold-const.c (fold_vec_perm): Take a const vec_perm_indices & instead of vec_perm_indices. * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise, (vect_gen_perm_mask_checked): Likewise, * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise, (vect_gen_perm_mask_checked): Likewise, Index: gcc/fold-const.c =================================================================== --- gcc/fold-const.c 2017-12-09 22:47:11.840391388 +0000 +++ gcc/fold-const.c 2017-12-09 22:47:19.119312754 +0000 @@ -8801,7 +8801,7 @@ vec_cst_ctor_to_array (tree arg, unsigne NULL_TREE otherwise. */ static tree -fold_vec_perm (tree type, tree arg0, tree arg1, vec_perm_indices sel) +fold_vec_perm (tree type, tree arg0, tree arg1, const vec_perm_indices &sel) { unsigned int i; bool need_ctor = false; Index: gcc/tree-vectorizer.h =================================================================== --- gcc/tree-vectorizer.h 2017-12-09 22:47:11.840391388 +0000 +++ gcc/tree-vectorizer.h 2017-12-09 22:47:19.120312754 +0000 @@ -1204,8 +1204,8 @@ extern void vect_get_load_cost (struct d extern void vect_get_store_cost (struct data_reference *, int, unsigned int *, stmt_vector_for_cost *); extern bool vect_supportable_shift (enum tree_code, tree); -extern tree vect_gen_perm_mask_any (tree, vec_perm_indices); -extern tree vect_gen_perm_mask_checked (tree, vec_perm_indices); +extern tree vect_gen_perm_mask_any (tree, const vec_perm_indices &); +extern tree vect_gen_perm_mask_checked (tree, const vec_perm_indices &); extern void optimize_mask_stores (struct loop*); /* In tree-vect-data-refs.c. */ Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c 2017-12-09 22:47:11.840391388 +0000 +++ gcc/tree-vect-stmts.c 2017-12-09 22:47:19.119312754 +0000 @@ -6506,7 +6506,7 @@ vectorizable_store (gimple *stmt, gimple vect_gen_perm_mask_checked. */ tree -vect_gen_perm_mask_any (tree vectype, vec_perm_indices sel) +vect_gen_perm_mask_any (tree vectype, const vec_perm_indices &sel) { tree mask_elt_type, mask_type; @@ -6527,7 +6527,7 @@ vect_gen_perm_mask_any (tree vectype, ve i.e. that the target supports the pattern _for arbitrary input vectors_. */ tree -vect_gen_perm_mask_checked (tree vectype, vec_perm_indices sel) +vect_gen_perm_mask_checked (tree vectype, const vec_perm_indices &sel) { gcc_assert (can_vec_perm_p (TYPE_MODE (vectype), false, &sel)); return vect_gen_perm_mask_any (vectype, sel);