run local_optimize() to remove tuple
[r7438]
else {
if (0 <= op->code && op->code < ARR_LEN(wenv->i_map)) {
const i_instr_record *r = wenv->i_map[op->code];
else {
if (0 <= op->code && op->code < ARR_LEN(wenv->i_map)) {
const i_instr_record *r = wenv->i_map[op->code];
- if (r) { /* we have a mapper */
- wenv->nr_of_intrinsics += r->i_mapper(node, r->ctx) ? 1 : 0;
+ /* run all possible mapper */
+ while (r) {
+ if (r->i_mapper(node, r->ctx)) {
+ ++wenv->nr_of_intrinsics;
+ break;
+ }
+ r = r->link;
}
}
}
}
/* Go through all graphs and map calls to intrinsic functions. */
}
}
}
}
/* Go through all graphs and map calls to intrinsic functions. */
-unsigned lower_intrinsics(const i_record *list, int length) {
+unsigned lower_intrinsics(i_record *list, int length) {
int i, n_ops = get_irp_n_opcodes();
ir_graph *irg;
pmap *c_map = pmap_create_ex(length);
int i, n_ops = get_irp_n_opcodes();
ir_graph *irg;
pmap *c_map = pmap_create_ex(length);
ir_op *op = list[i].i_instr.op;
assert(0 <= op->code && op->code < ARR_LEN(i_map));
ir_op *op = list[i].i_instr.op;
assert(0 <= op->code && op->code < ARR_LEN(i_map));
+ list[i].i_instr.link = i_map[op->code];
i_map[op->code] = &list[i].i_instr;
}
}
i_map[op->code] = &list[i].i_instr;
}
}
set_irg_doms_inconsistent(irg);
set_irg_loopinfo_inconsistent(irg);
set_irg_doms_inconsistent(irg);
set_irg_loopinfo_inconsistent(irg);
+ /* optimize it, tuple might be created */
+ local_optimize_graph(irg);
+
nr_of_intrinsics += wenv.nr_of_intrinsics;
}
}
nr_of_intrinsics += wenv.nr_of_intrinsics;
}
}
entity *i_ent; /**< the entity representing an intrinsic call */
i_mapper_func i_mapper; /**< the mapper function to call */
void *ctx; /**< mapper context */
entity *i_ent; /**< the entity representing an intrinsic call */
i_mapper_func i_mapper; /**< the mapper function to call */
void *ctx; /**< mapper context */
+ void *link; /**< used in the construction algorithm, must be NULL */
ir_op *op; /**< the opcode that must be mapped. */
i_mapper_func i_mapper; /**< the mapper function to call */
void *ctx; /**< mapper context */
ir_op *op; /**< the opcode that must be mapped. */
i_mapper_func i_mapper; /**< the mapper function to call */
void *ctx; /**< mapper context */
+ void *link; /**< used in the construction algorithm, must be NULL */
*
* @return number of found intrinsics.
*/
*
* @return number of found intrinsics.
*/
-unsigned lower_intrinsics(const i_record *list, int length);
+unsigned lower_intrinsics(i_record *list, int length);
/**
* A mapper for the integer absolute value: inttype abs(inttype v).
/**
* A mapper for the integer absolute value: inttype abs(inttype v).
INTRINSIC_INSTR,
op_Div,
i_mapper_RuntimeCall,
INTRINSIC_INSTR,
op_Div,
i_mapper_RuntimeCall,
INTRINSIC_INSTR,
op_Conv,
i_mapper_RuntimeCall,
INTRINSIC_INSTR,
op_Conv,
i_mapper_RuntimeCall,
+ &rt_Float2Double,
+ NULL