From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23233 invoked by alias); 5 Mar 2010 16:21:39 -0000 Received: (qmail 23222 invoked by uid 22791); 5 Mar 2010 16:21:38 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Mar 2010 16:21:34 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 204978765C; Fri, 5 Mar 2010 17:21:32 +0100 (CET) Date: Fri, 05 Mar 2010 17:06:00 -0000 From: Martin Jambor To: Richard Guenther Cc: GCC Patches , Jan Hubicka Subject: Re: [PATCH 2/6] Indirect call graph edges Message-ID: <20100305162131.GE2458@virgil.suse.cz> Mail-Followup-To: Richard Guenther , GCC Patches , Jan Hubicka References: <20100213180136.555197900@alvy.suse.cz> <20100213180157.129177066@alvy.suse.cz> <20100222154455.GB3026@kam.mff.cuni.cz> <84fc9c001002220802o5f36a310o2ed2d7e0a1359506@mail.gmail.com> <20100213180136.555197900@alvy.suse.cz> <20100213180157.129177066@alvy.suse.cz> <84fc9c001002131016s3a81d6a9ib25b73d8064473e5@mail.gmail.com> <84fc9c001002131025j301f6c4eg4872aa27d99f620b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <84fc9c001002220802o5f36a310o2ed2d7e0a1359506@mail.gmail.com> <84fc9c001002131025j301f6c4eg4872aa27d99f620b@mail.gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) 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: 2010-03/txt/msg00247.txt.bz2 Hi, On Sat, Feb 13, 2010 at 07:25:01PM +0100, Richard Guenther wrote: > On Sat, Feb 13, 2010 at 7:16 PM, Richard Guenther > wrote: > >> The data structure layout (a flag and a pointer in struct cgraph_edge > >> to a another special structure) was really chosen by Honza. The > >> subsequent patches add some more stuff to cgraph_indirect_call_info so > >> it won't look this silly for long. > >> > >> I have successfully bootstrapped and tested this beast on x86_84-linux > >> and would like to commit something along these lines when stage1 opens > >> again. Obviously, I welcome any comments. > > > > The cgraph.c file at the top currently contains very brief documentation > > which needs to be updated as it says: > > > > The callgraph at the moment does not represent indirect calls or calls > > from other compilation unit. Thanks, I have updated the comment. > > > > Note that I think we should have some more elaborate overall overview > > about the cgraph interface. > > Btw, I wonder what the callee node of an indirect edge points to? With this patch applied it points to whatever value is in the parameter with index edge->indirect_info->param_index. The index is initialized to -1 when creating an inedirect edge but at the moment I always set it to a non-negative value immediately afterwards. > Should we have a way to put a cgraph node set there? In IPA mod/ref > analysis it would be useful to know which functions can be reached > via an indirect call - the conservative set should be all functions > that had their address taken (but I believe we lie here for virtual > functions). > > Pointer analysis could also restrict the callee set like for > > void (*p)(void); > if (b) > p = foo; > else > p = bar; > (*p)(); > > where we know we either call foo or bar. Is there a suitable place to > note this kind of information? Well, you can put anything into struct cgraph_indirect_call_info, be it a head of a linked list of such nodes or a bitmap (node uids should be rather dense, since all concerned nodes are needed none of them should disappear and/or be reused and I don't think we will be redirecting these calls to clones). I will re-send the patch set (except those submitted/committed separately) soon. Thanks, Martin