public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Jambor <mjambor@suse.cz>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, PR 45934 1/6] [PR 46287] Do not generate direct calls to thunks
Date: Wed, 15 Dec 2010 15:15:00 -0000	[thread overview]
Message-ID: <20101215134421.GA24257@virgil.arch.suse.de> (raw)
In-Reply-To: <20101214171405.GD26788@atrey.karlin.mff.cuni.cz>

Hi,

On Tue, Dec 14, 2010 at 06:14:05PM +0100, Jan Hubicka wrote:
> > 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.

No, things would break just as they did break in the testcases if IPA
saw calls to thunk decls.

> 
> > 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?

IPA-CP never propagates constants along edges that it has made direct
(becase these edges did not participate in the analysis), if that is
the concern.  I agree that the final mechanism should be more general
and robust (and I guess we should meet for lunch early in January to
discuss it) but I certainly think this is good enough for 4.6.

> > 
> > > 
> > > 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.

Thanks a lot, I committed it as revision 167855.

Martin

  reply	other threads:[~2010-12-15 13:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-01 20:22 [PATCH, PR 45934 0/6] Devirtualization aware of dynamic type changes Martin Jambor
2010-12-01 20:22 ` [PATCH, PR 45934 3/6] More robust compute_complex_ancestor_jump_func Martin Jambor
2010-12-01 20:28   ` Richard Guenther
2010-12-01 20:23 ` [PATCH, PR 45934 1/6] [PR 46287] Do not generate direct calls to thunks Martin Jambor
2010-12-01 20:58   ` Jan Hubicka
2010-12-03 13:01     ` Martin Jambor
2010-12-14 17:39       ` Jan Hubicka
2010-12-15 15:15         ` Martin Jambor [this message]
2010-12-15 15:46           ` Jan Hubicka
2010-12-15 16:52             ` Martin Jambor
2010-12-17 14:14   ` H.J. Lu
2010-12-01 20:23 ` [PATCH, PR 45934 6/6] Intraprocedural type-based devirtualization Martin Jambor
2010-12-02 15:40   ` Richard Guenther
2010-12-01 20:23 ` [PATCH, PR 45934 4/6] Dynamic type change detection Martin Jambor
2010-12-02 15:19   ` Richard Guenther
2010-12-02 16:17     ` Richard Guenther
2010-12-09 11:30       ` Martin Jambor
2010-12-02 23:25   ` Jason Merrill
2010-12-03 13:45     ` Martin Jambor
2010-12-03 14:34       ` Gabriel Dos Reis
2010-12-03 16:07       ` Jason Merrill
2010-12-03 16:09         ` Richard Guenther
2010-12-03 16:21         ` Gabriel Dos Reis
2010-12-04 23:14           ` Jason Merrill
2010-12-01 20:23 ` [PATCH, PR 45934 5/6] Identify the new dynamic type after change Martin Jambor
2010-12-01 20:23 ` [PATCH, PR 45934 2/6] Remove devirtualizations that cannot be done Martin Jambor
2010-12-01 20:35   ` Richard Guenther
2010-12-02 10:46     ` Martin Jambor
2010-12-02 12:14       ` Richard Guenther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101215134421.GA24257@virgil.arch.suse.de \
    --to=mjambor@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).