From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11895 invoked by alias); 14 Dec 2010 17:14:18 -0000 Received: (qmail 11630 invoked by uid 22791); 14 Dec 2010 17:14:13 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ksp.mff.cuni.cz (HELO atrey.karlin.mff.cuni.cz) (195.113.26.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Dec 2010 17:14:08 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 810E7F1C1A; Tue, 14 Dec 2010 18:14:05 +0100 (CET) Date: Tue, 14 Dec 2010 17:39:00 -0000 From: Jan Hubicka To: Jan Hubicka , GCC Patches Subject: Re: [PATCH, PR 45934 1/6] [PR 46287] Do not generate direct calls to thunks Message-ID: <20101214171405.GD26788@atrey.karlin.mff.cuni.cz> References: <20101201201618.861802217@virgil.suse.cz> <20101201201710.617836287@virgil.suse.cz> <20101201205808.GD5575@kam.mff.cuni.cz> <20101203130049.GA3371@virgil.arch.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101203130049.GA3371@virgil.arch.suse.de> User-Agent: Mutt/1.5.18 (2008-05-17) 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-12/txt/msg01110.txt.bz2 > Hi, > > > I guess it is still fine as it is definite improvement over current > > situation, but won't we need to handle all of cgraph_thunk_info > > here? > > Eventually we will, certainly before we start propagating constants to > zeroth arguments of OBJ_TYPE_REFs. And not only here but also at I tought we do that via constant folding already. > other places (e.g. cgraph_set_call_stmt and company... and of course > there is the weird cgraph_create_edge_including_clones I wrote you > about earlier). Hmm... > > > In thunk_info it is HOST_WIDE_INT, I would expect it to be here as well. > > I extract it from BINFOs as tree constants and I need to use it in > POINTER_PLUSes as tree constants so there is probably no point in > striing it as H_W_I. Well, it is similar for the thunk code. In a way I preffer constants to be constants as they are easier to handle in GGC/LTO etc. but I do not care too much. > > Should've test here if this parameter was eliminated or not? > > (i.e. first bit of e->callee->clone.combined_args_to_skip? > > It is not strictly necessary because I do the callee modification > before removing parameters but on the second thought, yes, we should > avoid creating unnecessary stuff when it is this easy. So I will add > the check and the condition will be: > > if (e->indirect_info && e->indirect_info->thunk_delta > && integer_nonzerop (e->indirect_info->thunk_delta) > && (!e->callee->clone.combined_args_to_skip > || !bitmap_bit_p (e->callee->clone.combined_args_to_skip, 0))) OK... > > > > > > Index: icln/gcc/ipa-prop.c > > > =================================================================== > > > --- icln.orig/gcc/ipa-prop.c > > > +++ icln/gcc/ipa-prop.c > > > > I would expect somewhere here to be code handling updating of operand > > value for non-0 delta when doing ipa-cp propagation, but don't seem to > > be able to find it? > > What do you mean? IPA-CP stores the delta into the indirect info > structure of the corresponding edge and then the code in > gimple_adjust_this_by_delta performs the adjustment. Will then IPA-CP handle correctly call to thunk that calls to real function that just passes pointer to other function? > > > > > The rest seems OK. I am most concerned that we implement just part of thunk > > logic, but I see that you get deltas from BINFOs and the rest of adjustments > > are not there? > > > > Correct, for simple this adjusting thunks, BINFOs contain the decl of > the real function and the this delta separately, for more complex > thunks it stores the decl of an underlying thunk + a this delta which > would otherwise be adjusted in this thunk. > > And yes, we will certainly have to re-think how to represent thunks in > the cgraph in a more general way. > > Anyway, is the patch OK with the above change then? OK. Honza > > Thanks, > > Martin