Mercurial > hg > CbC > CbC_gcc
diff gcc/cfghooks.c @ 132:d34655255c78
update gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 10:21:07 +0900 |
parents | 84e7813d76e9 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/cfghooks.c Thu Oct 25 08:08:40 2018 +0900 +++ b/gcc/cfghooks.c Thu Oct 25 10:21:07 2018 +0900 @@ -1,5 +1,5 @@ /* Hooks for cfg representation specific functions. - Copyright (C) 2003-2017 Free Software Foundation, Inc. + Copyright (C) 2003-2018 Free Software Foundation, Inc. Contributed by Sebastian Pop <s.pop@laposte.net> This file is part of GCC. @@ -146,10 +146,12 @@ error ("verify_flow_info: Wrong count of block %i", bb->index); err = 1; } - if (bb->frequency < 0) + /* FIXME: Graphite and SLJL and target code still tends to produce + edges with no probablity. */ + if (profile_status_for_fn (cfun) >= PROFILE_GUESSED + && !bb->count.initialized_p () && !flag_graphite && 0) { - error ("verify_flow_info: Wrong frequency of block %i %i", - bb->index, bb->frequency); + error ("verify_flow_info: Missing count of block %i", bb->index); err = 1; } @@ -164,7 +166,7 @@ /* FIXME: Graphite and SLJL and target code still tends to produce edges with no probablity. */ if (profile_status_for_fn (cfun) >= PROFILE_GUESSED - && !e->probability.initialized_p () && 0) + && !e->probability.initialized_p () && !flag_graphite && 0) { error ("Uninitialized probability of edge %i->%i", e->src->index, e->dest->index); @@ -286,7 +288,7 @@ DEBUG_FUNCTION void debug (basic_block_def &ref) { - dump_bb (stderr, &ref, 0, 0); + dump_bb (stderr, &ref, 0, TDF_NONE); } DEBUG_FUNCTION void @@ -298,6 +300,14 @@ fprintf (stderr, "<nil>\n"); } +static void +debug_slim (basic_block ptr) +{ + fprintf (stderr, "<basic_block %p (%d)>", (void *) ptr, ptr->index); +} + +DEFINE_DEBUG_VEC (basic_block_def *) +DEFINE_DEBUG_HASH_SET (basic_block_def *) /* Dumps basic block BB to pretty-printer PP, for use as a label of a DOT graph record-node. The implementation of this hook is @@ -315,7 +325,6 @@ /* TODO: Add pretty printer for counter. */ if (bb->count.initialized_p ()) pp_printf (pp, "COUNT:" "%" PRId64, bb->count.to_gcov_type ()); - pp_printf (pp, " FREQ:%i |", bb->frequency); pp_write_text_to_stream (pp); if (!(dump_flags & TDF_SLIM)) cfg_hooks->dump_bb_for_graph (pp, bb); @@ -513,7 +522,6 @@ return NULL; new_bb->count = bb->count; - new_bb->frequency = bb->frequency; new_bb->discriminator = bb->discriminator; if (dom_info_available_p (CDI_DOMINATORS)) @@ -626,7 +634,6 @@ { basic_block ret; profile_count count = e->count (); - int freq = EDGE_FREQUENCY (e); edge f; bool irr = (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0; struct loop *loop; @@ -640,7 +647,6 @@ ret = cfg_hooks->split_edge (e); ret->count = count; - ret->frequency = freq; single_succ_edge (ret)->probability = profile_probability::always (); if (irr) @@ -869,7 +875,6 @@ fallthru = split_block_after_labels (bb); dummy = fallthru->src; dummy->count = profile_count::zero (); - dummy->frequency = 0; bb = fallthru->dest; /* Redirect back edges we want to keep. */ @@ -879,10 +884,6 @@ if (redirect_edge_p (e)) { - dummy->frequency += EDGE_FREQUENCY (e); - if (dummy->frequency > BB_FREQ_MAX) - dummy->frequency = BB_FREQ_MAX; - dummy->count += e->count (); ei_next (&ei); continue; @@ -1101,19 +1102,10 @@ new_bb->count = new_count; bb->count -= new_count; - new_bb->frequency = EDGE_FREQUENCY (e); - bb->frequency -= EDGE_FREQUENCY (e); - redirect_edge_and_branch_force (e, new_bb); - - if (bb->frequency < 0) - bb->frequency = 0; } else - { - new_bb->count = bb->count; - new_bb->frequency = bb->frequency; - } + new_bb->count = bb->count; set_bb_original (new_bb, bb); set_bb_copy (bb, new_bb); @@ -1463,13 +1455,6 @@ if (bb != ENTRY_BLOCK_PTR_FOR_FN (cfun) && profile_status_for_fn (cfun) != PROFILE_ABSENT) { - int sum = 0; - FOR_EACH_EDGE (e, ei, bb->preds) - sum += EDGE_FREQUENCY (e); - if (abs (sum - bb->frequency) > 100 - || (MAX (sum, bb->frequency) > 10 - && abs ((sum - bb->frequency) * 100 / (MAX (sum, bb->frequency) + 1)) > 10)) - record->num_mismatched_freq_in[after_pass]++; profile_count lsum = profile_count::zero (); FOR_EACH_EDGE (e, ei, bb->preds) lsum += e->count ();