From: Jan Hubicka Date: Sun, 2 Dec 2018 15:39:45 +0000 (+0100) Subject: bb-reorer.c (find_rarely_executed_basic_blocks_and_crossin_edges): trust precise... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b131f6a86798c11093eee79b6069139efb92af9;p=gcc.git bb-reorer.c (find_rarely_executed_basic_blocks_and_crossin_edges): trust precise profiles. * bb-reorer.c (find_rarely_executed_basic_blocks_and_crossin_edges): trust precise profiles. From-SVN: r266726 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a724451eb55..c143ee13a48 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-12-02 Jan Hubicka + + * bb-reorer.c (find_rarely_executed_basic_blocks_and_crossin_edges): + trust precise profiles. + 2018-12-02 Jakub Jelinek * tree-nested.c (convert_nonlocal_omp_clauses, diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index e20df160723..aaea525b69e 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -1663,17 +1663,19 @@ find_rarely_executed_basic_blocks_and_crossing_edges (void) if (probably_never_executed_bb_p (cfun, bb)) { + cold_bb = true; + /* Handle profile insanities created by upstream optimizations by also checking the incoming edge weights. If there is a non-cold incoming edge, conservatively prevent this block from being split into the cold section. */ - cold_bb = true; - FOR_EACH_EDGE (e, ei, bb->preds) - if (!probably_never_executed_edge_p (cfun, e)) - { - cold_bb = false; - break; - } + if (!bb->count.precise_p ()) + FOR_EACH_EDGE (e, ei, bb->preds) + if (!probably_never_executed_edge_p (cfun, e)) + { + cold_bb = false; + break; + } } if (cold_bb) {