diff options
Diffstat (limited to 'gcc-4.6/gcc/value-prof.c')
-rw-r--r-- | gcc-4.6/gcc/value-prof.c | 84 |
1 files changed, 51 insertions, 33 deletions
diff --git a/gcc-4.6/gcc/value-prof.c b/gcc-4.6/gcc/value-prof.c index 57a9918..6d67f6d 100644 --- a/gcc-4.6/gcc/value-prof.c +++ b/gcc-4.6/gcc/value-prof.c @@ -471,9 +471,10 @@ check_counter (gimple stmt, const char * name, : DECL_SOURCE_LOCATION (current_function_decl); if (flag_profile_correction) { - inform (locus, "correcting inconsistent value profile: " - "%s profiler overall count (%d) does not match BB count " - "(%d)", name, (int)*all, (int)bb_count); + if (flag_opt_info >= OPT_INFO_MAX) + inform (locus, "correcting inconsistent value profile: %s " + "profiler overall count (%d) does not match BB count " + "(%d)", name, (int)*all, (int)bb_count); *all = bb_count; if (*count > *all) *count = *all; @@ -509,33 +510,42 @@ check_ic_counter (gimple stmt, gcov_type *count1, gcov_type *count2, location_t locus; if (*count1 > all && flag_profile_correction) { - locus = (stmt != NULL) - ? gimple_location (stmt) - : DECL_SOURCE_LOCATION (current_function_decl); - inform (locus, "Correcting inconsistent value profile: " - "ic (topn) profiler top target count (%ld) exceeds " - "BB count (%ld)", (long)*count1, (long)all); + if (flag_opt_info >= OPT_INFO_MAX) + { + locus = (stmt != NULL) + ? gimple_location (stmt) + : DECL_SOURCE_LOCATION (current_function_decl); + inform (locus, "Correcting inconsistent value profile: " + "ic (topn) profiler top target count (%ld) exceeds " + "BB count (%ld)", (long)*count1, (long)all); + } *count1 = all; } if (*count2 > all && flag_profile_correction) { - locus = (stmt != NULL) - ? gimple_location (stmt) - : DECL_SOURCE_LOCATION (current_function_decl); - inform (locus, "Correcting inconsistent value profile: " - "ic (topn) profiler second target count (%ld) exceeds " - "BB count (%ld)", (long)*count2, (long)all); + if (flag_opt_info >= OPT_INFO_MAX) + { + locus = (stmt != NULL) + ? gimple_location (stmt) + : DECL_SOURCE_LOCATION (current_function_decl); + inform (locus, "Correcting inconsistent value profile: " + "ic (topn) profiler second target count (%ld) exceeds " + "BB count (%ld)", (long)*count2, (long)all); + } *count2 = all; } if (*count2 > *count1) { - locus = (stmt != NULL) - ? gimple_location (stmt) - : DECL_SOURCE_LOCATION (current_function_decl); - inform (locus, "Corrupted topn ic value profile: " - "first target count (%ld) is less than the second " - "target count (%ld)", (long)*count1, (long)*count2); + if (flag_opt_info >= OPT_INFO_MAX) + { + locus = (stmt != NULL) + ? gimple_location (stmt) + : DECL_SOURCE_LOCATION (current_function_decl); + inform (locus, "Corrupted topn ic value profile: " + "first target count (%ld) is less than the second " + "target count (%ld)", (long)*count1, (long)*count2); + } return true; } @@ -547,12 +557,16 @@ check_ic_counter (gimple stmt, gcov_type *count1, gcov_type *count2, *count2 = all - *count1; else { - locus = (stmt != NULL) - ? gimple_location (stmt) - : DECL_SOURCE_LOCATION (current_function_decl); - inform (locus, "Corrupted topn ic value profile: top two targets's" - " total count (%ld) exceeds bb count (%ld)", - (long)(*count1 + *count2), (long)all); + if (flag_opt_info >= OPT_INFO_MAX) + { + locus = (stmt != NULL) + ? gimple_location (stmt) + : DECL_SOURCE_LOCATION (current_function_decl); + inform (locus, + "Corrupted topn ic value profile: top two targets's" + " total count (%ld) exceeds bb count (%ld)", + (long)(*count1 + *count2), (long)all); + } return true; } } @@ -1186,8 +1200,11 @@ find_func_by_funcdef_no (int func_id) func_id) == NULL) { if (flag_profile_correction) - inform (DECL_SOURCE_LOCATION (current_function_decl), + { + if (flag_opt_info >= OPT_INFO_MED) + inform (DECL_SOURCE_LOCATION (current_function_decl), "Inconsistent profile: indirect call target (%d) does not exist", func_id); + } else error ("Inconsistent profile: indirect call target (%d) does not exist", func_id); @@ -1316,8 +1333,9 @@ check_ic_target (gimple call_stmt, struct cgraph_node *target) return true; locus = gimple_location (call_stmt); - inform (locus, "Skipping target %s with mismatching types for icall ", - cgraph_node_name (target)); + if (flag_opt_info >= OPT_INFO_MAX) + inform (locus, "Skipping target %s with mismatching types for icall ", + cgraph_node_name (target)); return false; } @@ -1579,7 +1597,7 @@ gimple_ic_transform_mult_targ (gimple stmt, histogram_value histogram) if (direct_call1 == NULL || !check_ic_target (stmt, direct_call1)) { - if (flag_ripa_verbose) + if (flag_opt_info >= OPT_INFO_MAX) { if (!direct_call1) inform (locus, "Can not find indirect call target decl " @@ -1605,7 +1623,7 @@ gimple_ic_transform_mult_targ (gimple stmt, histogram_value histogram) return false; modify1 = gimple_ic (stmt, direct_call1, prob1, count1, all); - if (flag_ripa_verbose) + if (flag_opt_info >= OPT_INFO_MIN) inform (locus, "Promote indirect call to target (call count:%u) %s", (unsigned) count1, lang_hooks.decl_printable_name (direct_call1->decl, 3)); @@ -1644,7 +1662,7 @@ gimple_ic_transform_mult_targ (gimple stmt, histogram_value histogram) modify2 = gimple_ic (stmt, direct_call2, prob2, count2, all - count1); - if (flag_ripa_verbose) + if (flag_opt_info >= OPT_INFO_MIN) inform (locus, "Promote indirect call to target (call count:%u) %s", (unsigned) count2, lang_hooks.decl_printable_name (direct_call2->decl, 3)); |