[google] With FDO/LIPO inline some cold callsites
Mark Heffernan
meheff@google.com
Tue Aug 23 21:28:00 GMT 2011
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hot_caller.patch
Type: text/x-patch
Size: 7760 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110823/f9f957ff/attachment.bin>
More information about the Gcc-patches
mailing list