This patch fixes the issue of indirect call promotion while using AutoFDO optimized binary to collect profile, and use the new profile to re-optimize the binary. Before the patch, the indirect call is promoted (and likely inlined) in the profiled binary, and will not be promoted in the new iteration. With the patch, a new iterative vpt+einline pass is added before annotation to make sure hot promoted indirect calls are still promoted before annotation.
2013-10-11 Dehao Chen <dehao@google.com>
* gcc/coverage.h (check_ic_target): New declaration.
* gcc/auto-profile.c (stmt_set): New type.
(function_instance::find_icall_target_map): New function.
(autofdo_source_profile::update_inlined_ind_target): New function.
(get_relative_location_for_stmt): New function.
(has_indirect_call): New function.
(afdo_get_bb_count): New parameter.
(afdo_vpt_for_early_inline): New function.
(afdo_annotate_cfg): New parameter.
* gcc/passes.c (init_optimization_passes): Change order.
* gcc/value-prof.c (check_ic_target): Change scope.
* gcc/ipa-inline.c (early_inliner): Change scope.
* gcc/ipa-inline.h (early_inliner): New declaration.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/google@203445 138bc75d-0d04-0410-961f-82ee72b054a4