public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95565] New: [Feature request] add a flag to only instrument function entry.
@ 2020-06-06 23:14 hiraditya at msn dot com
  2020-06-06 23:16 ` [Bug tree-optimization/95565] " hiraditya at msn dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: hiraditya at msn dot com @ 2020-06-06 23:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95565

            Bug ID: 95565
           Summary: [Feature request] add a flag to only instrument
                    function entry.
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hiraditya at msn dot com
  Target Milestone: ---

The flag -finstrument-functions instruments both entry and the exit of
function. There are many scenarios (like cheap profiling) only instrumenting
the function entry is sufficient. But gcc instruments exit as well contributing
to unwanted code size increase.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug tree-optimization/95565] [Feature request] add a flag to only instrument function entry.
  2020-06-06 23:14 [Bug tree-optimization/95565] New: [Feature request] add a flag to only instrument function entry hiraditya at msn dot com
@ 2020-06-06 23:16 ` hiraditya at msn dot com
  2020-06-09  6:51 ` rguenth at gcc dot gnu.org
  2022-09-21 21:44 ` hiraditya at msn dot com
  2 siblings, 0 replies; 4+ messages in thread
From: hiraditya at msn dot com @ 2020-06-06 23:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95565

--- Comment #1 from AK <hiraditya at msn dot com> ---
I believe we need to conditionally disable the following code, but I'm not sure
of all the implications. If someone can implement it that'd be great.

```
gcc/gimplify.c   Around Line:14997

      x = builtin_decl_implicit (BUILT_IN_RETURN_ADDRESS);
      call = gimple_build_call (x, 1, integer_zero_node);
      tmp_var = create_tmp_var (ptr_type_node, "return_addr");
      gimple_call_set_lhs (call, tmp_var);
      gimplify_seq_add_stmt (&cleanup, call);
      x = builtin_decl_implicit (BUILT_IN_PROFILE_FUNC_EXIT);
      call = gimple_build_call (x, 2, this_fn_addr, tmp_var);
      gimplify_seq_add_stmt (&cleanup, call);
      tf = gimple_build_try (seq, cleanup, GIMPLE_TRY_FINALLY);


```

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug tree-optimization/95565] [Feature request] add a flag to only instrument function entry.
  2020-06-06 23:14 [Bug tree-optimization/95565] New: [Feature request] add a flag to only instrument function entry hiraditya at msn dot com
  2020-06-06 23:16 ` [Bug tree-optimization/95565] " hiraditya at msn dot com
@ 2020-06-09  6:51 ` rguenth at gcc dot gnu.org
  2022-09-21 21:44 ` hiraditya at msn dot com
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-09  6:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95565

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug tree-optimization/95565] [Feature request] add a flag to only instrument function entry.
  2020-06-06 23:14 [Bug tree-optimization/95565] New: [Feature request] add a flag to only instrument function entry hiraditya at msn dot com
  2020-06-06 23:16 ` [Bug tree-optimization/95565] " hiraditya at msn dot com
  2020-06-09  6:51 ` rguenth at gcc dot gnu.org
@ 2022-09-21 21:44 ` hiraditya at msn dot com
  2 siblings, 0 replies; 4+ messages in thread
From: hiraditya at msn dot com @ 2022-09-21 21:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95565

--- Comment #2 from AK <hiraditya at msn dot com> ---
clang has `-finstrument-function-entry-bare` to this effect: 
https://reviews.llvm.org/D40276

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-21 21:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-06 23:14 [Bug tree-optimization/95565] New: [Feature request] add a flag to only instrument function entry hiraditya at msn dot com
2020-06-06 23:16 ` [Bug tree-optimization/95565] " hiraditya at msn dot com
2020-06-09  6:51 ` rguenth at gcc dot gnu.org
2022-09-21 21:44 ` hiraditya at msn dot com

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