+2018-01-09 Jan Hubicka <hubicka@ucw.cz>
+
+ PR middle-end/83575
+ * predict.c (force_edge_cold): Handle in more sane way edges
+ with no prediction.
+
2018-01-09 Carl Love <cel@us.ibm.com>
* config/rs6002/altivec.md (p8_vmrgow): Add support for V2DI, V2DF,
edge e2;
bool uninitialized_exit = false;
+ /* When branch probability guesses are not known, then do nothing. */
+ if (!impossible && !e->count ().initialized_p ())
+ return;
+
profile_probability goal = (impossible ? profile_probability::never ()
: profile_probability::very_unlikely ());
FOR_EACH_EDGE (e2, ei, e->src->succs)
if (e2 != e)
{
+ if (e->flags & EDGE_FAKE)
+ continue;
if (e2->count ().initialized_p ())
count_sum += e2->count ();
- else
- uninitialized_exit = true;
if (e2->probability.initialized_p ())
prob_sum += e2->probability;
+ else
+ uninitialized_exit = true;
}
+ /* If we are not guessing profiles but have some other edges out,
+ just assume the control flow goes elsewhere. */
+ if (uninitialized_exit)
+ e->probability = goal;
/* If there are other edges out of e->src, redistribute probabilitity
there. */
- if (prob_sum > profile_probability::never ())
+ else if (prob_sum > profile_probability::never ())
{
if (!(e->probability < goal))
e->probability = goal;
update_br_prob_note (e->src);
if (e->src->count == profile_count::zero ())
return;
- if (count_sum == profile_count::zero () && !uninitialized_exit
- && impossible)
+ if (count_sum == profile_count::zero () && impossible)
{
bool found = false;
if (e->src == ENTRY_BLOCK_PTR_FOR_FN (cfun))