ir_graph *const irg = get_irn_irg(irn);
ir_node *const block = get_nodes_block(irn);
int const arity = get_irn_arity(irn);
ir_graph *const irg = get_irn_irg(irn);
ir_node *const block = get_nodes_block(irn);
int const arity = get_irn_arity(irn);
arch_set_irn_register(res1, cycle.elems[i]);
/* insert the copy/exchange node in schedule after the magic schedule node (see above) */
arch_set_irn_register(res1, cycle.elems[i]);
/* insert the copy/exchange node in schedule after the magic schedule node (see above) */
- DBG((dbg, LEVEL_1, "replacing %+F with %+F, placed new node after %+F\n", irn, cpyxchg, sched_point));
+ DB((dbg, LEVEL_1, "replacing %+F with %+F, placed new node after %+F\n", irn, cpyxchg, sched_point));
- DBG((dbg, LEVEL_1, "%+F creating copy node (%+F, %s) -> (%+F, %s)\n",
+ DB((dbg, LEVEL_1, "%+F creating copy node (%+F, %s) -> (%+F, %s)\n",
irn, arg1, cycle.elems[i]->name, res2, cycle.elems[i + 1]->name));
cpyxchg = be_new_Copy(reg_class, irg, block, arg1);
irn, arg1, cycle.elems[i]->name, res2, cycle.elems[i + 1]->name));
cpyxchg = be_new_Copy(reg_class, irg, block, arg1);
- DBG((dbg_constr, LEVEL_1, "ignore constraint for %+F because other_irn is ignore or not a datab node\n", irn));
+ DB((dbg_constr, LEVEL_1, "ignore constraint for %+F because other_irn is ignore or not a datab node\n", irn));
cpy = find_copy(skip_Proj(irn), other_different);
if (! cpy) {
cpy = be_new_Copy(cls, irg, block, other_different);
cpy = find_copy(skip_Proj(irn), other_different);
if (! cpy) {
cpy = be_new_Copy(cls, irg, block, other_different);
- be_node_set_flags(cpy, BE_OUT_POS(0), arch_irn_flags_dont_spill);
- DBG((dbg_constr, LEVEL_1, "created non-spillable %+F for value %+F\n", cpy, other_different));
+ arch_irn_set_flags(cpy, arch_irn_flags_dont_spill);
+ DB((dbg_constr, LEVEL_1, "created non-spillable %+F for value %+F\n", cpy, other_different));
- DBG((dbg_constr, LEVEL_1, "using already existing %+F for value %+F\n", cpy, other_different));
+ DB((dbg_constr, LEVEL_1, "using already existing %+F for value %+F\n", cpy, other_different));
}
/* Add the Keep resp. CopyKeep and reroute the users */
/* of the other_different irn in case of CopyKeep. */
if (has_irn_users(other_different)) {
keep = be_new_CopyKeep_single(cls, irg, block, cpy, irn, get_irn_mode(other_different));
}
/* Add the Keep resp. CopyKeep and reroute the users */
/* of the other_different irn in case of CopyKeep. */
if (has_irn_users(other_different)) {
keep = be_new_CopyKeep_single(cls, irg, block, cpy, irn, get_irn_mode(other_different));
keep = be_new_Keep(cls, irg, block, 2, in);
}
keep = be_new_Keep(cls, irg, block, 2, in);
}
- DBG((dbg_constr, LEVEL_1, "created %+F(%+F, %+F)\n\n", keep, irn, cpy));
+ DB((dbg_constr, LEVEL_1, "created %+F(%+F, %+F)\n\n", keep, irn, cpy));
/* insert copy and keep into schedule */
assert(sched_is_scheduled(irn) && "need schedule to assure constraints");
if (! sched_is_scheduled(cpy))
sched_add_before(skip_Proj(irn), cpy);
/* insert copy and keep into schedule */
assert(sched_is_scheduled(irn) && "need schedule to assure constraints");
if (! sched_is_scheduled(cpy))
sched_add_before(skip_Proj(irn), cpy);
/* insert the other different and it's copies into the map */
entry = ir_nodemap_get(op_set, other_different);
/* insert the other different and it's copies into the map */
entry = ir_nodemap_get(op_set, other_different);
ref_mode_T = skip_Proj(get_irn_n(ref, 1));
obstack_grow(&obst, &ref, sizeof(ref));
ref_mode_T = skip_Proj(get_irn_n(ref, 1));
obstack_grow(&obst, &ref, sizeof(ref));
- DBG((dbg_constr, LEVEL_1, "Trying to melt %+F:\n", ref));
+ DB((dbg_constr, LEVEL_1, "Trying to melt %+F:\n", ref));
/* check for copykeeps pointing to the same mode_T node as the reference copykeep */
for (j = 0; j < num_ck; ++j) {
/* check for copykeeps pointing to the same mode_T node as the reference copykeep */
for (j = 0; j < num_ck; ++j) {
if (j != idx && cur_ck && skip_Proj(get_irn_n(cur_ck, 1)) == ref_mode_T) {
obstack_grow(&obst, &cur_ck, sizeof(cur_ck));
ir_nodeset_remove(&entry->copies, cur_ck);
if (j != idx && cur_ck && skip_Proj(get_irn_n(cur_ck, 1)) == ref_mode_T) {
obstack_grow(&obst, &cur_ck, sizeof(cur_ck));
ir_nodeset_remove(&entry->copies, cur_ck);
- DBG((dbg_constr, LEVEL_1, "\t%+F\n", cur_ck));
+ DB((dbg_constr, LEVEL_1, "\t%+F\n", cur_ck));
} while (be_is_Keep(sched_pt) || be_is_CopyKeep(sched_pt));
sched_add_before(sched_pt, new_ck);
} while (be_is_Keep(sched_pt) || be_is_CopyKeep(sched_pt));
sched_add_before(sched_pt, new_ck);
- DBG((dbg_constr, LEVEL_1, "created %+F, scheduled before %+F\n", new_ck, sched_pt));
+ DB((dbg_constr, LEVEL_1, "created %+F, scheduled before %+F\n", new_ck, sched_pt));
- op_copy_assoc_t *entry = map_entry.data;
- int n;
- ir_node *cp;
- ir_nodeset_iterator_t iter;
+ op_copy_assoc_t *entry = map_entry.data;
+ int n = ir_nodeset_size(&entry->copies);
+ ir_node **nodes = ALLOCAN(ir_node*, n);
+ ir_node *cp;
+ ir_nodeset_iterator_t iter;
/* put the node in an array */
DBG((dbg_constr, LEVEL_1, "introduce copies for %+F ", map_entry.node));
/* put the node in an array */
DBG((dbg_constr, LEVEL_1, "introduce copies for %+F ", map_entry.node));
- DBG((dbg_permmove, LEVEL_1, "perm move %+F irg %+F\n", perm, irg));
+ DB((dbg_permmove, LEVEL_1, "perm move %+F irg %+F\n", perm, irg));
- DBG((dbg_permmove, LEVEL_2, "\tfrontier: %+F\n", frontier));
+ DB((dbg_permmove, LEVEL_2, "\tfrontier: %+F\n", frontier));
- map = alloca(new_size * sizeof(map[0]));
- proj_map = alloca(arity * sizeof(proj_map[0]));
+ map = ALLOCAN(int, new_size);
+ proj_map = ALLOCAN(int, arity);
memset(proj_map, -1, sizeof(proj_map[0]));
n = 0;
for (i = 0; i < arity; ++i) {
memset(proj_map, -1, sizeof(proj_map[0]));
n = 0;
for (i = 0; i < arity; ++i) {