From: Richard Guenther <rguenther@suse.de>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: gcc-patches@gcc.gnu.org, mjambor@suse.cz
Subject: Re: [RFA] Cgraph alias reorg 7/14 (no longer try to diable devirtualization on thunks)
Date: Fri, 10 Jun 2011 13:53:00 -0000 [thread overview]
Message-ID: <alpine.LNX.2.00.1106101531230.810@zhemvz.fhfr.qr> (raw)
In-Reply-To: <20110610130252.GE28776@kam.mff.cuni.cz>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 6366 bytes --]
On Fri, 10 Jun 2011, Jan Hubicka wrote:
> Hi,
> code to refuse thunks in gimple_get_virt_method_for_binfo is no-op since I
> comitted the thunk rewrite: thunks no longer have same_bodyy_alias flag set.
> Only case where it chould diable the devirtualization is when NODE is NULL,
> but that won't really happen for thunks anyway.
> Consequentely this patch removes the code.
>
> Regtested/bootstrapped x86_64-linux, OK?
Ok.
Thanks,
Richard.
> Honza
>
> * ipa-cp.c (ipcp_process_devirtualization_opportunities):
> Update call of gimple_get_virt_method_for_binfo.
> * gimple-fold.c (gimple_get_virt_method_for_binfo): Remove
> refuse_thunks parameter.
> (gimple_fold_call): Update.
> * ipa-prop.c (try_make_edge_direct_virtual_call): Update.
> Index: ipa-cp.c
> ===================================================================
> *** ipa-cp.c (revision 174895)
> --- ipa-cp.c (working copy)
> *************** ipcp_process_devirtualization_opportunit
> *** 1190,1197 ****
> binfo = get_binfo_at_offset (binfo, anc_offset, otr_type);
> if (!binfo)
> continue;
> ! target = gimple_get_virt_method_for_binfo (token, binfo, &delta,
> ! false);
> }
> else
> {
> --- 1190,1196 ----
> binfo = get_binfo_at_offset (binfo, anc_offset, otr_type);
> if (!binfo)
> continue;
> ! target = gimple_get_virt_method_for_binfo (token, binfo, &delta);
> }
> else
> {
> *************** ipcp_process_devirtualization_opportunit
> *** 1214,1220 ****
> break;
> }
>
> ! t = gimple_get_virt_method_for_binfo (token, binfo, &d, true);
> if (!t)
> {
> target = NULL_TREE;
> --- 1213,1219 ----
> break;
> }
>
> ! t = gimple_get_virt_method_for_binfo (token, binfo, &d);
> if (!t)
> {
> target = NULL_TREE;
> Index: gimple-fold.c
> ===================================================================
> *** gimple-fold.c (revision 174895)
> --- gimple-fold.c (working copy)
> *************** gimple_fold_builtin (gimple stmt)
> *** 1373,1383 ****
>
> tree
> gimple_get_virt_method_for_binfo (HOST_WIDE_INT token, tree known_binfo,
> ! tree *delta, bool refuse_thunks)
> {
> HOST_WIDE_INT i;
> tree v, fndecl;
> - struct cgraph_node *node;
>
> v = BINFO_VIRTUALS (known_binfo);
> /* If there is no virtual methods leave the OBJ_TYPE_REF alone. */
> --- 1373,1382 ----
>
> tree
> gimple_get_virt_method_for_binfo (HOST_WIDE_INT token, tree known_binfo,
> ! tree *delta)
> {
> HOST_WIDE_INT i;
> tree v, fndecl;
>
> v = BINFO_VIRTUALS (known_binfo);
> /* If there is no virtual methods leave the OBJ_TYPE_REF alone. */
> *************** gimple_get_virt_method_for_binfo (HOST_W
> *** 1396,1413 ****
> return NULL_TREE;
>
> fndecl = TREE_VALUE (v);
> - node = cgraph_get_node_or_alias (fndecl);
> - if (refuse_thunks
> - && (!node
> - /* Bail out if it is a thunk declaration. Since simple this_adjusting
> - thunks are represented by a constant in TREE_PURPOSE of items in
> - BINFO_VIRTUALS, this is a more complicate type which we cannot handle as
> - yet.
> -
> - FIXME: Remove the following condition once we are able to represent
> - thunk information on call graph edges. */
> - || (node->same_body_alias && node->thunk.thunk_p)))
> - return NULL_TREE;
>
> /* When cgraph node is missing and function is not public, we cannot
> devirtualize. This can happen in WHOPR when the actual method
> --- 1395,1400 ----
> *************** gimple_fold_call (gimple_stmt_iterator *
> *** 1557,1563 ****
> if (!binfo)
> return false;
> token = TREE_INT_CST_LOW (OBJ_TYPE_REF_TOKEN (callee));
> ! fndecl = gimple_get_virt_method_for_binfo (token, binfo, &delta, false);
> if (!fndecl)
> return false;
> gcc_assert (integer_zerop (delta));
> --- 1544,1550 ----
> if (!binfo)
> return false;
> token = TREE_INT_CST_LOW (OBJ_TYPE_REF_TOKEN (callee));
> ! fndecl = gimple_get_virt_method_for_binfo (token, binfo, &delta);
> if (!fndecl)
> return false;
> gcc_assert (integer_zerop (delta));
> Index: ipa-prop.c
> ===================================================================
> *** ipa-prop.c (revision 174895)
> --- ipa-prop.c (working copy)
> *************** try_make_edge_direct_virtual_call (struc
> *** 1771,1777 ****
> type = ie->indirect_info->otr_type;
> binfo = get_binfo_at_offset (binfo, ie->indirect_info->anc_offset, type);
> if (binfo)
> ! target = gimple_get_virt_method_for_binfo (token, binfo, &delta, true);
> else
> return NULL;
>
> --- 1771,1777 ----
> type = ie->indirect_info->otr_type;
> binfo = get_binfo_at_offset (binfo, ie->indirect_info->anc_offset, type);
> if (binfo)
> ! target = gimple_get_virt_method_for_binfo (token, binfo, &delta);
> else
> return NULL;
>
> Index: gimple.h
> ===================================================================
> *** gimple.h (revision 174895)
> --- gimple.h (working copy)
> *************** unsigned get_gimple_rhs_num_ops (enum tr
> *** 904,910 ****
> gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
> const char *gimple_decl_printable_name (tree, int);
> bool gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace);
> ! tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree, tree *, bool);
> void gimple_adjust_this_by_delta (gimple_stmt_iterator *, tree);
> tree gimple_extract_devirt_binfo_from_cst (tree);
> /* Returns true iff T is a valid GIMPLE statement. */
> --- 904,910 ----
> gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
> const char *gimple_decl_printable_name (tree, int);
> bool gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace);
> ! tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree, tree *);
> void gimple_adjust_this_by_delta (gimple_stmt_iterator *, tree);
> tree gimple_extract_devirt_binfo_from_cst (tree);
> /* Returns true iff T is a valid GIMPLE statement. */
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
prev parent reply other threads:[~2011-06-10 13:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-10 13:23 Jan Hubicka
2011-06-10 13:53 ` Richard Guenther [this message]
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=alpine.LNX.2.00.1106101531230.810@zhemvz.fhfr.qr \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=mjambor@suse.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).