From 0a54994896aeeab947c22d6fec1cf83533de4b0f Mon Sep 17 00:00:00 2001 From: dehao Date: Thu, 20 Mar 2014 22:00:46 +0000 Subject: [PATCH] Add early_inline wrapper to call compute_inline_parameters and update_ssa properly. 2014-03-20 Dehao Chen * gcc/auto-profile.c (afdo_vpt_for_early_inline): Move function call to the wrapper. (early_inline): New wrapper. (auto_profile): Move function call to the wrapper. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/google@208738 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc-4_8/gcc/auto-profile.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gcc-4_8/gcc/auto-profile.c b/gcc-4_8/gcc/auto-profile.c index 46970717183..7712eedf4f4 100644 --- a/gcc-4_8/gcc/auto-profile.c +++ b/gcc-4_8/gcc/auto-profile.c @@ -1449,8 +1449,6 @@ afdo_vpt_for_early_inline (stmt_set *promoted_stmts) calculate_dominance_info (CDI_POST_DOMINATORS); calculate_dominance_info (CDI_DOMINATORS); rebuild_cgraph_edges (); - update_ssa (TODO_update_ssa); - compute_inline_parameters (cgraph_get_node (current_function_decl), true); return true; } else @@ -1516,6 +1514,14 @@ afdo_annotate_cfg (const stmt_set &promoted_stmts) } } /* namespace autofdo. */ +static void early_inline () +{ + compute_inline_parameters (cgraph_get_node (current_function_decl), true); + unsigned todo = early_inliner (); + if (todo & TODO_update_ssa_any) + update_ssa (TODO_update_ssa); +} + /* Use AutoFDO profile to annoate the control flow graph. Return the todo flag. */ @@ -1610,11 +1616,10 @@ auto_profile (void) if (!flag_value_profile_transformations || !autofdo::afdo_vpt_for_early_inline (&promoted_stmts)) break; - early_inliner (); + early_inline (); } - compute_inline_parameters (cgraph_get_node (current_function_decl), true); - early_inliner (); + early_inline (); autofdo::afdo_annotate_cfg (promoted_stmts); compute_function_frequency (); update_ssa (TODO_update_ssa); -- 2.11.4.GIT