public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Ilya Enkovich <enkovich.gnu@gmail.com>
Cc: Jan Hubicka <hubicka@ucw.cz>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [CHKP] Support returned bounds in thunks expand
Date: Tue, 07 Apr 2015 20:33:00 -0000	[thread overview]
Message-ID: <20150407203319.GA91010@kam.mff.cuni.cz> (raw)
In-Reply-To: <20150407141133.GC11622@msticlxl57.ims.intel.com>

> > > 
> > > The problem with instrumented call is that instrumented function
> > > returns two values and call lhs gets only the first one. Thus we
> > > generate bndret call to get the second one to build own return with
> > > two values.
> > 
> > I see, patch is OK then (preferably merging as much as possible with ipa-split)
> > 
> > Honza
> 
> Here is a refactored version with common code moved to tree-chkp.c.  Bootstrapped and tested on x86_64-unknown-linux-gnu.  Does it look OK?
> 
> Thanks,
> Ilya
> --
> gcc/
> 
> 2015-04-07  Ilya Enkovich  <ilya.enkovich@intel.com>
> 
> 	* tree-chkp.h (chkp_insert_retbnd_call): New.
> 	* tree-chkp.c (chkp_insert_retbnd_call): New.
> 	* ipa-split.c (insert_bndret_call_after): Remove.
> 	(split_function): Use chkp_insert_retbnd_call.
> 	* cgraphunit.c (cgraph_node::expand_thunk): Build returned
> 	bounds for instrumented functions.
> 
> gcc/testsuite/
> 
> 2015-04-07  Ilya Enkovich  <ilya.enkovich@intel.com>
> 
> 	* gcc/testsuite/gcc.target/i386/thunk-retbnd.c: New.

OK, thanks!
> @@ -1697,6 +1698,17 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
>        gsi_insert_after (&bsi, call, GSI_NEW_STMT);
>        if (!alias_is_noreturn)
>  	{
> +	  if (instrumentation_clone
> +	      && !DECL_BY_REFERENCE (resdecl)
> +	      && restmp
> +	      && BOUNDED_P (restmp))
> +	    {
> +	      resbnd = chkp_insert_retbnd_call (NULL, restmp, &bsi);
> +	      create_edge (get_create (gimple_call_fndecl (gsi_stmt (bsi))),
> +			   as_a <gcall *> (gsi_stmt (bsi)),
> +			   callees->count, callees->frequency);
> +	    }

Is there any reasons the rtbnd builtin call is not gimple_call_internal_p?
That way we would not need to worry about representing this in callgraph.

Honza

  reply	other threads:[~2015-04-07 20:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 10:13 Ilya Enkovich
2015-04-02 14:49 ` Ilya Enkovich
2015-04-02 19:42   ` Jeff Law
2015-04-03  8:38     ` Ilya Enkovich
2015-04-02 20:55   ` Jan Hubicka
2015-04-03  8:46     ` Ilya Enkovich
2015-04-03 17:05       ` Jan Hubicka
2015-04-07 14:12         ` Ilya Enkovich
2015-04-07 20:33           ` Jan Hubicka [this message]
2015-04-07 23:28             ` Ilya Enkovich

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=20150407203319.GA91010@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=enkovich.gnu@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).