This patch sets cgraph_node count during AutoFDO annotation, otherwise execute_fixup_cfg will clear all the BB counts.
bootstrapped and passed regression test. OK for google-4_8 branch? Thanks, Dehao Index: gcc/auto-profile.c =================================================================== --- gcc/auto-profile.c (revision 202753) +++ gcc/auto-profile.c (working copy) @@ -1234,6 +1234,7 @@ afdo_annotate_cfg (void) if (s == NULL) return; + cgraph_get_node (current_function_decl)->count = s->head_count (); ENTRY_BLOCK_PTR->count = s->head_count (); gcov_type max_count = ENTRY_BLOCK_PTR->count;