From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17667 invoked by alias); 23 Jun 2017 10:32:10 -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 16814 invoked by uid 89); 23 Jun 2017 10:32:09 -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,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= 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, 23 Jun 2017 10:32:07 +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 475107EBD3; Fri, 23 Jun 2017 10:32:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 475107EBD3 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 475107EBD3 Received: from tucnak.zalov.cz (ovpn-116-143.ams2.redhat.com [10.36.116.143]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB9906FB63; Fri, 23 Jun 2017 10:32:05 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v5NAW3ka028232; Fri, 23 Jun 2017 12:32:03 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v5NAW1T8028231; Fri, 23 Jun 2017 12:32:01 +0200 Date: Fri, 23 Jun 2017 10:32:00 -0000 From: Jakub Jelinek To: Richard Biener Cc: Aldy Hernandez , Andrew MacLeod , gcc-patches Subject: Re: Avoid generating useless range info Message-ID: <20170623103201.GC2123@tucnak> Reply-To: Jakub Jelinek References: <85de74ae-9680-1461-a289-42c915b5285a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01761.txt.bz2 On Fri, Jun 23, 2017 at 12:24:25PM +0200, Richard Biener wrote: > > void > > set_nonzero_bits (tree name, const wide_int_ref &mask) > > { > > gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name))); > > if (SSA_NAME_RANGE_INFO (name) == NULL) > > set_range_info (name, VR_RANGE, > > TYPE_MIN_VALUE (TREE_TYPE (name)), > > TYPE_MAX_VALUE (TREE_TYPE (name))); > > range_info_def *ri = SSA_NAME_RANGE_INFO (name); > > ri->set_nonzero_bits (mask); > > } > > > > Let me know how you'd like me to proceed. > > Just factor out a set_range_info_raw and call that then from here. And don't call it if the mask is all ones. Perhaps set_range_info and set_nonzero_bits even should ggc_free and clear earlier range_info_def if the range is all values and nonzero bit mask is all ones. Or do we share range_info_def between multiple SSA_NAMEs? If yes, of course we shouldn't use ggc_free. Jakub