This patch fixes the issue of indirect call promotion while using AutoFDO optimized...
commitcdbfaa3e1c6b75c960f6d983b70a712631f6042d
authordehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Oct 2013 14:30:28 +0000 (11 14:30 +0000)
committerdehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Oct 2013 14:30:28 +0000 (11 14:30 +0000)
tree75cb2e723271bb1d27bf8f33858355de343744f7
parent6b0896964f035e88d555240ef441baf72127854c
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
gcc-4_8/gcc/auto-profile.c
gcc-4_8/gcc/coverage.h
gcc-4_8/gcc/ipa-inline.c
gcc-4_8/gcc/ipa-inline.h
gcc-4_8/gcc/passes.c
gcc-4_8/gcc/value-prof.c