From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32016 invoked by alias); 4 Apr 2011 18:01:30 -0000 Received: (qmail 32008 invoked by uid 22791); 4 Apr 2011 18:01:29 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Apr 2011 18:01:18 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p34I1BII019906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Apr 2011 14:01:11 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p34I1Ar2030891; Mon, 4 Apr 2011 14:01:11 -0400 Received: from [10.3.113.84] (ovpn-113-84.phx2.redhat.com [10.3.113.84]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p34I19JS009919; Mon, 4 Apr 2011 14:01:09 -0400 Message-ID: <4D9A0765.6020901@redhat.com> Date: Mon, 04 Apr 2011 18:01:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.9 MIME-Version: 1.0 To: Nathan Froyd CC: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] cleanup gcse.c:canon_modify_mem_list References: <20110404014451.GA16239@nightcrawler> In-Reply-To: <20110404014451.GA16239@nightcrawler> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2011-04/txt/msg00238.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 04/03/11 19:44, Nathan Froyd wrote: > The patch below converts gcse.c:canon_modify_mem_list to hold VECs > instead of EXPR_LIST rtxes. I am ambivalent about the use of VECs in > canon_modify_mem_list; they will waste some memory compared to the > linked list scheme present before, though I'm not sure how much. It > would depend on the average chain length, etc. I'm happy to use an > linked list datastructure instead, allocated out of an > alloc_pool (better statistics!) or even gcse's private obstack if folks > think that would be better. Moving things out of GC memory and > eliminating a use of EXPR_LIST has to be considered a good thing, > though... I've got no strong opinions on all this stuff -- except that blindly moving stuff out of GC memory isn't necessarily a good thing. It really depends on the lifetime of the objects. Assuming the memory list stuff in gcse doesn't have a lifetime outside of GCSE and is thus easily tracked, then I've got no fundamental objection to the change. > > Doing this required addressing an odd little comment in > record_last_mem_set_info: > > if (CALL_P (insn)) > { > /* Note that traversals of this loop (other than for free-ing) > will break after encountering a CALL_INSN. So, there's no > need to insert a pair of items, as canon_list_insert does. */ > canon_modify_mem_list[bb] = > alloc_INSN_LIST (insn, canon_modify_mem_list[bb]); > bitmap_set_bit (blocks_with_calls, bb); > } > > This is all well and good, except that the only real traversal of > canon_modify_mem_list (compute_transp) doesn't check for CALL_INSNs. It's possible (likely?) the implementation changed over time and the comment wasn't properly updated. Unfortunate, but it does happen. > + canon_modify_mem_list = GCNEWVEC (VEC(modify_pair,heap) *, > + last_basic_block); nit; You're missing some whitespace here (after the VEC). OK. Please install, Thanks, Jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNmgdkAAoJEBRtltQi2kC7QagH/AkchggJ4C7SU2AasolDyQqn tcQowd5zBmiYFujY9+UgIL6Wh6AVU/Ls452c96MVKKWcDi8kIW0y3tzlls5yYbKW /XtvuzPU9zhya672mjTNktD3mPFj4qKtAO7PsjCh375uvkSknSXCAP9B5O9nQPbR BdaaAHv4gLgrpIokFTxk5455/7BGMCNJ0/O91PR4Jyithc2wZsz6Me4AFg+aMZG/ t+Vq7+6D5kALiXrrn2UNzrGefE6i6HdbacP6drOaDI1XNmI8Se4NgiE/JQfkvKty 1i4MVGW2IJrMax7fCKLhIRErQxEgfGQVfOLk5WkQXSzxfvILLu1bkdTTLKTr6t0= =tTk7 -----END PGP SIGNATURE-----