This patch is for google_main branch only. This patch fixes the ICE when using LIPO ...
13 years, 4 months ago
(2011-12-22 00:12:04 UTC)
#1
This patch is for google_main branch only.
This patch fixes the ICE when using LIPO profiles for regular FDO
compilation. LIPO has INDIR_CALL_TOPN profiles while FDO has
INDIR_CALL profile.
Tested with SPEC2000 INT (with -Wno-coverage-mismatch to work around
the minor pass difference b/w LIPO and FDO)
-Rong
2011-12-21 Rong Xu <xur@google.com>
* gcc/profile.c (compute_value_histograms): handle the
case when INDIR_CALL counters not available in gcda files.
Index: gcc/profile.c
===================================================================
--- gcc/profile.c (revision 182415)
+++ gcc/profile.c (working copy)
@@ -828,6 +828,19 @@
t = (int) hist->type;
aact_count = act_count[t];
+ if (aact_count == 0)
+ {
+ /* this can only happen when FDO uses LIPO profiles where
+ we have HIST_TYPE_INDIR_CALL_TOPN counters in gcda
+ files. */
+ gcc_assert (hist->type == HIST_TYPE_INDIR_CALL);
+ if (flag_opt_info >= OPT_INFO_MIN)
+ warning (0, "cannot find INDIR_CALL counters. "
+ "Using LIPO profiles?\n",
+ DECL_ASSEMBLER_NAME (current_function_decl));
+ hist->n_counters = 0;
+ continue;
+ }
act_count[t] += hist->n_counters;
gimple_add_histogram_value (cfun, stmt, hist);
--
This patch is available for review at http://codereview.appspot.com/5500068
ok for google branches David On Wed, Dec 21, 2011 at 4:12 PM, Rong Xu ...
13 years, 3 months ago
(2011-12-27 07:21:10 UTC)
#2
ok for google branches
David
On Wed, Dec 21, 2011 at 4:12 PM, Rong Xu <xur@google.com> wrote:
> This patch is for google_main branch only.
>
> This patch fixes the ICE when using LIPO profiles for regular FDO
> compilation. LIPO has INDIR_CALL_TOPN profiles while FDO has
> INDIR_CALL profile.
>
> Tested with SPEC2000 INT (with -Wno-coverage-mismatch to work around
> the minor pass difference b/w LIPO and FDO)
>
>
> -Rong
>
> 2011-12-21 Rong Xu <xur@google.com>
>
> * gcc/profile.c (compute_value_histograms): handle the
> case when INDIR_CALL counters not available in gcda files.
>
> Index: gcc/profile.c
> ===================================================================
> --- gcc/profile.c (revision 182415)
> +++ gcc/profile.c (working copy)
> @@ -828,6 +828,19 @@
> t = (int) hist->type;
>
> aact_count = act_count[t];
> + if (aact_count == 0)
> + {
> + /* this can only happen when FDO uses LIPO profiles where
> + we have HIST_TYPE_INDIR_CALL_TOPN counters in gcda
> + files. */
> + gcc_assert (hist->type == HIST_TYPE_INDIR_CALL);
> + if (flag_opt_info >= OPT_INFO_MIN)
> + warning (0, "cannot find INDIR_CALL counters. "
> + "Using LIPO profiles?\n",
> + DECL_ASSEMBLER_NAME (current_function_decl));
> + hist->n_counters = 0;
> + continue;
> + }
> act_count[t] += hist->n_counters;
>
> gimple_add_histogram_value (cfun, stmt, hist);
>
> --
> This patch is available for review at http://codereview.appspot.com/5500068
Issue 5500068: [google] fix ICE when using LIPO profiles for FDO
Created 13 years, 4 months ago by xur
Modified 13 years, 3 months ago
Reviewers: davidxl
Base URL: svn+ssh://gcc.gnu.org/svn/gcc/branches/google/main/
Comments: 0