From: Michael Beck Date: Fri, 27 Jun 2008 16:06:43 +0000 (+0000) Subject: do a correct rounding when calculating 70%, or small cases did not get optimized... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=e5beeab8b7b91878088417de02683bf15cba1c59;p=libfirm do a correct rounding when calculating 70%, or small cases did not get optimized well [r20279] --- diff --git a/ir/ir/irarch.c b/ir/ir/irarch.c index 351368770..5f9fdfe96 100644 --- a/ir/ir/irarch.c +++ b/ir/ir/irarch.c @@ -545,7 +545,7 @@ static ir_node *do_decomposition(ir_node *irn, ir_node *operand, tarval *tv) { inst = decompose_mul(&env, R, r, tv); /* the paper suggests 70% here */ - mul_costs = (env.evaluate(MUL, tv) * 7) / 10; + mul_costs = (env.evaluate(MUL, tv) * 7 + 5) / 10; if (evaluate_insn(&env, inst) <= mul_costs && !env.fail) { env.op = operand; env.blk = get_nodes_block(irn);