do a correct rounding when calculating 70%, or small cases did not get optimized...
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 27 Jun 2008 16:06:43 +0000 (16:06 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 27 Jun 2008 16:06:43 +0000 (16:06 +0000)
[r20279]

ir/ir/irarch.c

index 3513687..5f9fdfe 100644 (file)
@@ -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);