diff mbox

[google,gcc-4_8] Make AutoFDO and plugin based function layout work.

Message ID CAAs8Hmz4kRG0UT6gLCy4BD+d9qco7TQccJpDm4q4CmADjsWpUQ@mail.gmail.com
State New
Headers show

Commit Message

Sriraman Tallam Nov. 27, 2013, 2:44 a.m. UTC
Google ref b/11631232

With AutoFDO, the .gnu.callgraph sections are not emitted with option
-freorder-functions=callgraph. This simple patch fixes it.


Ok to commit?

Sri

Comments

Xinliang David Li Nov. 27, 2013, 2:50 a.m. UTC | #1
Ok.

David

On Tue, Nov 26, 2013 at 6:44 PM, Sriraman Tallam <tmsriram@google.com> wrote:
> Google ref b/11631232
>
> With AutoFDO, the .gnu.callgraph sections are not emitted with option
> -freorder-functions=callgraph. This simple patch fixes it.
>
> Index: final.c
> ===================================================================
> --- final.c (revision 205418)
> +++ final.c (working copy)
> @@ -4471,7 +4471,7 @@
>    /* With -fcallgraph-profiles-sections and -freorder-functions=,
>       add ".gnu.callgraph.text" section for storing profiling information. */
>    if ((flag_reorder_functions > 1)
> -      && flag_profile_use
> +      && (flag_profile_use || flag_auto_profile)
>        && cgraph_get_node (current_function_decl) != NULL
>        && ((cgraph_get_node (current_function_decl))->callees != NULL
>    || (cgraph_get_node (current_function_decl))->count > 0))
>
> Ok to commit?
>
> Sri
diff mbox

Patch

Index: final.c
===================================================================
--- final.c (revision 205418)
+++ final.c (working copy)
@@ -4471,7 +4471,7 @@ 
   /* With -fcallgraph-profiles-sections and -freorder-functions=,
      add ".gnu.callgraph.text" section for storing profiling information. */
   if ((flag_reorder_functions > 1)
-      && flag_profile_use
+      && (flag_profile_use || flag_auto_profile)
       && cgraph_get_node (current_function_decl) != NULL
       && ((cgraph_get_node (current_function_decl))->callees != NULL
   || (cgraph_get_node (current_function_decl))->count > 0))