[google] With FDO/LIPO inline some cold callsites

Xinliang David Li davidxl@google.com
Tue Aug 23 21:58:00 GMT 2011


The patch makes sense as inlining cold callsites can sharpen analysis
in the hot caller leading to more aggressive optimization.

Ok for google branch.

Thanks,

David

On Tue, Aug 23, 2011 at 12:56 PM, Mark Heffernan <meheff@google.com> wrote:
> The following patch changes the inliner callsite filter with FDO/LIPO.
>  Previously, cold callsites were unconditionally rejected.  Now the
> callsite may still be inlined if the _caller_ is sufficiently hot (max
> count of any bb in the function is above hot threshold).  This gives
> about 0.5 - 1% geomean performance on x86-64 (depending on microarch)
> on internal benchmarks with < 1% average code size increase.
>
> Bootstrapped and reg tested.  Ok for google/gcc-4_6?
>
> Mark
>
> 2011-08-23  Mark Heffernan  <meheff@google.com>
>
>        * basic-block.h (maybe_hot_frequency_p): Add prototype.
>        * cgraph.c (dump_cgraph_node): Add field to dump.
>        (cgraph_clone_node) Handle new field.
>        * cgraph.h (cgraph_node): New field max_bb_count.
>        * cgraphbuild.c (rebuild_cgraph_edges): Compute max_bb_count.
>        * cgraphunit.c (cgraph_copy_node_for_versioning) Handle new field.
>        * common.opt (finline-hot-caller): New option.
>        * ipa-inline.c (cgraph_mark_inline_edge) Update max_bb_count.
>        (edge_hot_enough_p) New function.
>        (cgraph_decide_inlining_of_small_functions) Call edge_hot_enough_p.
>        * predict.c (maybe_hot_frequency_p): Remove static keyword and
>        guard with profile_info check.
>        * testsuite/gcc.dg/tree-prof/inliner-1.c: Add flag.
>        * testsuite/gcc.dg/tree-prof/lipo/inliner-1_0.c: Add flag.
>



More information about the Gcc-patches mailing list