On 2021/12/29 03:33, Jan Hubicka wrote:
>> - /* Proportion second loop's bb counts except those dominated by false
>> - branch to avoid drop 1s down. */
>> - basic_block bbi_copy = get_bb_copy (false_edge->dest);
>> - bbs2 = get_loop_body (loop2);
>> - for (j = 0; j < loop2->num_nodes; j++)
>> - if (bbs2[j] == loop2->latch
>> - || !dominated_by_p (CDI_DOMINATORS, bbs2[j], bbi_copy))
>> - bbs2[j]->count = bbs2[j]->count.apply_probability (
>> - true_edge->probability.invert ());
>> - free (bbs2);
>> + if (true_edge->probability.initialized_p ())
>> + {
>> + edge exit_to_latch1 = single_pred_edge (loop1->latch);
>> + exit_to_latch1->probability
>> + = exit_to_latch1->probability.apply_scale (
>> + true_edge->probability.to_reg_br_prob_base (),
>> + REG_BR_PROB_BASE);
> This should be
> exit_to_latch1->probability *= true_edge->probability;
> whici will do the right thing to undefined probabilities and will not
> cause unnecesary roundoff errors and precision info loss.
>
> Can you please update that in the patch (and drop the initialized_p
> check)?
Thanks, updated and committed with r12-6140.
--
Thanks,
Xionghu