From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116430 invoked by alias); 27 Oct 2017 15:32:05 -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 116421 invoked by uid 89); 27 Oct 2017 15:32:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1848 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Oct 2017 15:32:03 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2BB8320273; Fri, 27 Oct 2017 15:32:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2BB8320273 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law@redhat.com Received: from localhost.localdomain (ovpn-112-16.phx2.redhat.com [10.3.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6E7680DE2; Fri, 27 Oct 2017 15:32:01 +0000 (UTC) Subject: Re: [07/nn] Add unique CONSTs To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org References: <87wp3mxgir.fsf@linaro.org> <87376axg6i.fsf@linaro.org> From: Jeff Law Message-ID: <359ac0f4-658c-6679-aa6f-8e08555eecc6@redhat.com> Date: Fri, 27 Oct 2017 15:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <87376axg6i.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg02087.txt.bz2 On 10/23/2017 05:21 AM, Richard Sandiford wrote: > This patch adds a way of treating certain kinds of CONST as unique, > so that pointer equality is equivalent to value equality. For now it > is restricted to VEC_DUPLICATE and VEC_SERIES, although the code to > generate them remains in the else arm of an "if (1)" until a later > patch. > > This is needed so that (const (vec_duplicate xx)) can used as the > CONSTxx_RTX of a variable-length vector. You're brave :-) I know we looked at making CONST_INTs behave in this manner eons ago in an effort to reduce memory consumption and it was just plain painful. There may still be comments from that project littering the source code. I do wonder if we might want to revisit this again as we have better infrastructure in place. > > > 2017-10-23 Richard Sandiford > Alan Hayward > David Sherwood > > gcc/ > * rtl.h (unique_const_p): New function. > (gen_rtx_CONST): Declare. > * emit-rtl.c (const_hasher): New struct. > (const_htab): New variable. > (init_emit_once): Initialize it. > (const_hasher::hash, const_hasher::equal): New functions. > (gen_rtx_CONST): New function. > (spare_vec_duplicate, spare_vec_series): New variables. > (gen_const_vec_duplicate_1): Add code for use (const (vec_duplicate)), > but disable it for now. > (gen_const_vec_series): Likewise (const (vec_series)). > * gengenrtl.c (special_rtx): Return true for CONST. > * rtl.c (shared_const_p): Return true if unique_const_p. ISTM that you need an update the rtl.texi's structure sharing assumptions section to describe the new rules around CONSTs. So what's the purpose of the sparc_vec_* stuff that you're going to use in the future? It looks like a single element cache to me. Am I missing something? jeff