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: 846618 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-468852-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Q5VQdue+"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yvQ083816z9s84 for ; Sun, 10 Dec 2017 10:09:28 +1100 (AEDT) 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=kX1Kl6UoKFsyEx/TTd/2Ri9XAv5O1 S3woKWXooAQIxCk7Dg7k5ASqq+xwkpKLEkyunXPIxDiba3xFN21D/PerlwoyesLg JHOS8WKCIdAl6ozK7YAzwivyEHjlAgVRlpB6wtBLsQ5RWgBbF+Y5zn+JsiZUZdZs kvD+BHeZLWPNvE= 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=Q5V Qdue+01+JN9v5UofJTkNATRaVabLvVWYBDYT8IiClpuV4ec2W+nc0eem0AzAGCe7 oax79jenbXgsuoig4ZoZF6deB1SrAUQHZouqwruKrVjuxYKvD1AcwzqZQthaEwEZ zZLRJb+2Yi2T6AjHEo0B3kM0h9qZsjb6XSp6Q9oI= 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-Google-Smtp-Source: AGs4zMbzyj//zIAoE4gQ7kcdg9hM/Vi89eS3wjBj9gjHb3JhmObX1HytNoDL+X92xmhi9hJ2zVPm5Q== 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);