From: Matthias Braun Date: Mon, 1 Dec 2008 13:54:47 +0000 (+0000) Subject: bad blocks have cf_probability 0 X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=81c42baca549a1199a49b8c31fe239b95f3c9df8;p=libfirm bad blocks have cf_probability 0 [r24186] --- diff --git a/ir/ana/execfreq.c b/ir/ana/execfreq.c index e312cd3be..c6cbf1ecc 100644 --- a/ir/ana/execfreq.c +++ b/ir/ana/execfreq.c @@ -181,13 +181,19 @@ solve_lgs(gs_matrix_t *mat, double *x, int size) static double get_cf_probability(ir_node *bb, int pos, double loop_weight) { - double sum = 0.0; - double cur = 0.0; - const ir_node *pred = get_Block_cfgpred_block(bb, pos); - const ir_loop *pred_loop = get_irn_loop(pred); - int pred_depth = get_loop_depth(pred_loop); + double sum = 0.0; + double cur = 0.0; + const ir_node *pred = get_Block_cfgpred_block(bb, pos); + const ir_loop *pred_loop; + int pred_depth; const ir_edge_t *edge; + if (is_Bad(pred)) + return 0; + + pred_loop = get_irn_loop(pred); + pred_depth = get_loop_depth(pred_loop); + cur = get_loop_depth(get_irn_loop(bb)) < get_loop_depth(get_irn_loop(pred)) ? 1.0 : loop_weight; foreach_block_succ(pred, edge) {