From patchwork Tue Jan 2 15:26:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 123150 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp9088667qgn; Tue, 2 Jan 2018 07:27:02 -0800 (PST) X-Google-Smtp-Source: ACJfBosdpSzzqBnS+vOsz6ag+OfKCnl45QrIR5pWZN9/JjK7sKu0qs1UNHK4ox1/LhYNA5N5cPje X-Received: by 10.99.65.197 with SMTP id o188mr6806946pga.193.1514906822519; Tue, 02 Jan 2018 07:27:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514906822; cv=none; d=google.com; s=arc-20160816; b=scz0DxZF4OKyvhynENZC1foEySoeYdb24FDJnFS5So91S7mjkBXjgXwQhIU4URhsMH npofzoYyTk4Z53CbAgMxz8Us0rBN9GMe0b4lgx5B8HPNiqNK+z+on46Ktt9Oowj2iiyV 3XIL7FrPDXa68GYG/icbX7eLWi1v5by6BrFNT5HFTVW5PUMLkLlX8SdJfP14Rww3pa0Z 2z2cEGLek5B8i38Ju0b3EpTWWieyyxjgAAuo7IafXF7c0yiRbpsqKAMiH4ibCFXqtX4H riy9QXWac4CPWdxV5eKO56/1blwFkGevtYX1h3PIqIjs9huTMZKwnatZ1h6bxOsI6eKN x9uQ== 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=NXFfoIjIVMCteLwoFsfRMn4NTvhI6fcKBR/c4Y86um0=; b=Vl0oNcnYwLRetCqrxQkOw/AQqTKSpTyznUsNi+A37HIOXEzIzuwl+fD0PW193nwNGN Yg7tNthlixKSB9A4nMTaV7uK1QcXH5upO8XPlfBbs0pUbfrbNOmcWuHP7/zDRlg3ATss 1vCYTrfxYhCuC5jpoOMEhkwsIa6yMhWCH+HQiI6usSxqmEPk7gSNEKoeQbCP5bJm5PZ+ 8QMCJ5I8IHQ8Ukih/wrKXee7aguftvTVICgdDxWBY1yOhJ4Ts6Pg+wmwHo3DMsoBRxpX hzzMCaTg9s4CMVtD4qnUGQzFVYaWAnxqLLSxOk3KvXNcgLFn6T5sljkv1zNQ7NyVf6i/ Xd4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lwJsu3oH; spf=pass (google.com: domain of gcc-patches-return-469974-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-469974-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 n15si5003165pgd.648.2018.01.02.07.27.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jan 2018 07:27:02 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-469974-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=lwJsu3oH; spf=pass (google.com: domain of gcc-patches-return-469974-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-469974-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=ggxLD/YW7HoP/WzuJ/+mB9Sgcpggm seS3CcWHjO81gI4O2LmthHbr2UUBLr7DxDGpqJSK20xJ0DTgoHEs2DFbU1S9aDFv 6NMQfdwyhUgDjjlsuauL6v8BxOQx3NRntT0u99UvxXh5KFgHjUouhrWdMWCidpJv FO//FyTzXz9EkQ= 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=OEpBTDMTqhcuAevDAnfOh/twGY8=; b=lwJ su3oHA2wEnZxR+MXYCzU2HDGIzu9oWAAu+cJt+4+L4fnOiSMTInW0bVjq1jXEw8X M/ZkTsWwgfMMbhTKsNCH4ChFPvU0S0j3UL+BeppBqdkSbHBaQxrPF7+XGxU4c8Jl zFWGBMFYqsJK19OkbSO0e82lzDLGC+zqMfNHrnqg= Received: (qmail 36568 invoked by alias); 2 Jan 2018 15:26:50 -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 36553 invoked by uid 89); 2 Jan 2018 15:26:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 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=posting X-HELO: mail-wm0-f44.google.com Received: from mail-wm0-f44.google.com (HELO mail-wm0-f44.google.com) (74.125.82.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Jan 2018 15:26:48 +0000 Received: by mail-wm0-f44.google.com with SMTP id g130so16745199wme.0 for ; Tue, 02 Jan 2018 07:26:47 -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=NXFfoIjIVMCteLwoFsfRMn4NTvhI6fcKBR/c4Y86um0=; b=boEtFcJt0Z4YYTgoXRCmqhgfp/h7bhLk08u1XhDICy79u9diRj1Ec8LAcFhKIgd30F 48irskL29kuZZsLPt0ICYQDCHNBCu02iNbEuSc5Sydb1+0epyuSmXxWZn5VHBkpp6Tus //l0JmcbV2rxcWbJwinqprlwvySKKRmdYxAd5tyITgVbz52E8SQnFnAOKHXIMCDvZ2Wq Qko9IwgKnoufHlHYKEpPArSqtOijb25QlRiPMXmatCbnwx2uTJyKKFRvHnngZqVICwGQ bj008VE7mrIh/Dj7lKJoME6q0cOCKPnWr6s8Gi+6+BGjFHQkNML9vgdiWUD+I7XwlLog ocLQ== X-Gm-Message-State: AKGB3mILQF17JSM/U4jczl+2fWzH3IPcRHtQ9NkZhBhvQKWEHnvrZ3rc JJlVnMjORr7k3a4RaTfyLYdYqbacoMw= X-Received: by 10.28.140.206 with SMTP id o197mr33045397wmd.43.1514906805989; Tue, 02 Jan 2018 07:26:45 -0800 (PST) Received: from localhost ([95.144.14.233]) by smtp.gmail.com with ESMTPSA id d71sm47480949wma.7.2018.01.02.07.26.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Jan 2018 07:26:45 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [5/4] Directly operate on CONST_VECTOR encoding References: <874loainn7.fsf@linaro.org> Date: Tue, 02 Jan 2018 15:26:44 +0000 In-Reply-To: <874loainn7.fsf@linaro.org> (Richard Sandiford's message of "Thu, 28 Dec 2017 20:49:16 +0000") Message-ID: <87wp10nux7.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 This patch makes some pieces of code operate directly on the new CONST_VECTOR encoding. Sorry for the late posting, I'd forgotten to include the patch when sending the original series. Tested as before. Thanks, Richard 2018-01-02 Richard Sandiford gcc/ * cse.c (hash_rtx_cb): Hash only the encoded elements. * cselib.c (cselib_hash_rtx): Likewise. * expmed.c (make_tree): Build VECTOR_CSTs directly from the CONST_VECTOR encoding. Index: gcc/cse.c =================================================================== --- gcc/cse.c 2017-12-22 16:54:09.325037396 +0000 +++ gcc/cse.c 2018-01-02 15:23:39.278076397 +0000 @@ -2353,11 +2353,11 @@ hash_rtx_cb (const_rtx x, machine_mode m int units; rtx elt; - units = CONST_VECTOR_NUNITS (x); + units = const_vector_encoded_nelts (x); for (i = 0; i < units; ++i) { - elt = CONST_VECTOR_ELT (x, i); + elt = CONST_VECTOR_ENCODED_ELT (x, i); hash += hash_rtx_cb (elt, GET_MODE (elt), do_not_record_p, hash_arg_in_memory_p, have_reg_qty, cb); Index: gcc/cselib.c =================================================================== --- gcc/cselib.c 2017-12-28 17:10:07.075025248 +0000 +++ gcc/cselib.c 2018-01-02 15:23:39.279076354 +0000 @@ -1163,11 +1163,11 @@ cselib_hash_rtx (rtx x, int create, mach int units; rtx elt; - units = CONST_VECTOR_NUNITS (x); + units = const_vector_encoded_nelts (x); for (i = 0; i < units; ++i) { - elt = CONST_VECTOR_ELT (x, i); + elt = CONST_VECTOR_ENCODED_ELT (x, i); hash += cselib_hash_rtx (elt, 0, memmode); } Index: gcc/expmed.c =================================================================== --- gcc/expmed.c 2018-01-02 15:12:14.964299450 +0000 +++ gcc/expmed.c 2018-01-02 15:23:39.279076354 +0000 @@ -5273,13 +5273,14 @@ make_tree (tree type, rtx x) case CONST_VECTOR: { - int units = CONST_VECTOR_NUNITS (x); + unsigned int npatterns = CONST_VECTOR_NPATTERNS (x); + unsigned int nelts_per_pattern = CONST_VECTOR_NELTS_PER_PATTERN (x); tree itype = TREE_TYPE (type); - int i; /* Build a tree with vector elements. */ - tree_vector_builder elts (type, units, 1); - for (i = 0; i < units; ++i) + tree_vector_builder elts (type, npatterns, nelts_per_pattern); + unsigned int count = elts.encoded_nelts (); + for (unsigned int i = 0; i < count; ++i) { rtx elt = CONST_VECTOR_ELT (x, i); elts.quick_push (make_tree (itype, elt));