Comments

The following patch will be committed to google/main. It improves
performance of internal benchmarks significantly.
This is a patch that improves static function promotion in LIPO mode.
1) Do not promote non address taken static functions -- this greately
reduce the number of promotions and allows more DFE after inlining. This
also makes inline size estimation more consistent across profile-gen
and profile-use
2) Delay static promotion just before tree-profiling after early inlining
is done. This is to make sure consistent size estimation
3) For emition of static init functions from aux modules. Those functions
will be eliminated later (they are not called from global dtor/ctor) --
there existence is important to make sure address taken (etc) attributes
for called dtor/ctors are consistent between profile-gen and use.
2011-05-30 David Li <davidxl@google.com>
* cgraphunit.c (cgraph_optimize): Remove call to static
promotion funciton.
* cp/decl2.c (cp_process_pending_declarations): Do not
remove body of __static_init functions for aux modules.
* ipa-inline.c (leaf_node_p): Filter indirect callsite
to make sure profile gen and profile use consistency
(cgraph_decide_inlining_incrementally): Remove LIPO
specific inline rule used to workaround size estimation
problem for static functions.
* tree-profile.c (tree_profiling): Do static promotion here.
* l-ipo.c (cgraph_is_aux_decl_external): Handle non-promoted
static function.
(create_unique_name): New function.
(promote_static_var_func): Do not promote non addr taken statics.
--
This patch is available for review at http://codereview.appspot.com/4517117