From e5beeab8b7b91878088417de02683bf15cba1c59 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 27 Jun 2008 16:06:43 +0000 Subject: [PATCH] do a correct rounding when calculating 70%, or small cases did not get optimized well [r20279] --- ir/ir/irarch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.20.1