DBG((dbg, LEVEL_1, "\tinsn: %+F, pressure: %d\n", irn, pressure));
DBG((dbg, LEVEL_2, "\tlive: %B\n", live));
-#ifndef SCHEDULE_PROJS
if (get_irn_mode(irn) == mode_T) {
const ir_edge_t *edge;
}
}
}
-#endif
+
/*
* If the node defines some value, which can put into a
* register of the current class, make a border for it.
pre_colored += arch_get_irn_register(arch_env, p) != NULL;
}
}
-
-#ifdef SCHEDULE_PROJS
- /* When Proj's are scheduled, so we need to find the first
- non-Proj instruction in the schedule */
- for (p = sched_next(irn); is_Proj(p); p = sched_next(p));
- insn->next_insn = p;
-#endif
-
} else if (arch_irn_consider_in_reg_alloc(arch_env, env->cls, irn)) {
/* only one def, create one operand */
o.req = arch_get_register_req(arch_env, irn, -1);
ir_node *proj = new_r_Proj(irg, bl, perm, mode, i);
arch_set_irn_register(arch_env, proj, reg);
-#ifdef SCHEDULE_PROJS
- sched_add_after(curr, proj);
-#endif
curr = proj;
be_ssa_construction_init(&senv, birg);
make_users_ready(env, irn);
}
-#ifdef SCHEDULE_PROJS
-/**
- * Add the proj nodes of a tuple-mode irn to the schedule immediately
- * after the tuple-moded irn. By pinning the projs after the irn, no
- * other nodes can create a new lifetime between the tuple-moded irn and
- * one of its projs. This should render a realistic image of a
- * tuple-moded irn, which in fact models a node which defines multiple
- * values.
- *
- * @param irn The tuple-moded irn.
- */
-static void add_tuple_projs(block_sched_env_t *env, ir_node *irn)
-{
- const ir_edge_t *edge;
-
- assert(get_irn_mode(irn) == mode_T && "Mode of node must be tuple");
-
- if (is_Bad(irn))
- return;
-
-
- /* non-proj nodes can have dependency edges to tuple nodes. */
- foreach_out_edge_kind(irn, edge, EDGE_KIND_DEP) {
- ir_node *out = get_edge_src_irn(edge);
- make_ready(env, irn, out);
- }
-
- /* schedule the normal projs */
- foreach_out_edge(irn, edge) {
- ir_node *out = get_edge_src_irn(edge);
-
- assert(is_Proj(out) && "successor of a modeT node must be a proj");
-
- if (get_irn_mode(out) == mode_T) {
- add_tuple_projs(env, out);
- } else {
- add_to_sched(env, out);
- }
- }
-}
-#endif
-
/**
* Perform list scheduling on a block.
*
/* Add the node to the schedule. */
add_to_sched(&be, irn);
-#ifdef SCHEDULE_PROJS
- if (get_irn_mode(irn) == mode_T)
- add_tuple_projs(&be, irn);
-#endif
-
/* remove the scheduled node from the ready list. */
ir_nodeset_remove(&be.cands, irn);
}
* function. */
assert(!is_Phi(node) && "liveness_transfer produces invalid results for phi nodes");
-#ifndef SCHEDULE_PROJS
if (get_irn_mode(node) == mode_T) {
const ir_edge_t *edge;
}
}
}
-#endif
if (arch_irn_consider_in_reg_alloc(arch_env, cls, node)) {
ir_nodeset_remove(nodeset, node);
set_Proj_proj(pairs[i].out_node, get_Proj_proj(pairs[i].in_node));
}
-#ifdef SCHEDULE_PROJS
- /* remove the proj from the schedule */
- sched_remove(pairs[i].out_node);
-#endif
-
/* reroute the edges from the proj to the argument */
exchange(pairs[i].out_node, pairs[i].in_node);
//edges_reroute(pairs[i].out_node, pairs[i].in_node, env->birg->irg);
/* set as in for next Perm */
pairs[pidx].in_node = res1;
}
- else {
-#ifdef SCHEDULE_PROJS
- sched_remove(res1);
-#endif
- }
-
-#ifdef SCHEDULE_PROJS
- sched_remove(res2);
-#endif
set_Proj_pred(res2, cpyxchg);
set_Proj_proj(res2, 0);
set_Proj_pred(res1, cpyxchg);
set_Proj_proj(res1, 1);
-#ifdef SCHEDULE_PROJS
- sched_add_after(sched_point, res1);
- sched_add_after(sched_point, res2);
-#endif
arch_set_irn_register(arch_env, res2, cycle->elems[i + 1]);
arch_set_irn_register(arch_env, res1, cycle->elems[i]);
arch_set_irn_register(arch_env, cpyxchg, cycle->elems[i + 1]);
n_ops++;
-#ifdef SCHEDULE_PROJS
- /* remove the proj from the schedule */
- sched_remove(res2);
-#endif
/* exchange copy node and proj */
exchange(res2, cpyxchg);
/* reroute all users of the proj to the moved node. */
edges_reroute(proj, move, irg);
-#ifdef SCHEDULE_PROJS
- /* remove the proj from the schedule. */
- sched_remove(proj);
-#endif
-
/* and like it to bad so it is no more in the use array of the perm */
set_Proj_pred(proj, get_irg_bad(irg));
#define _sched_entry(list_head) (list_entry(list_head, sched_info_t, list))
-#ifndef SCHEDULE_PROJS
#define get_irn_sched_info(irn) get_irn_data(skip_Proj_const(irn), sched_info_t, sched_irn_data_offset)
-#else
-#define get_irn_sched_info(irn) get_irn_data(irn, sched_info_t, sched_irn_data_offset)
-#endif
#define get_sched_info_irn(sched_info) get_irn_data_base(sched_info, sched_irn_data_offset)
case iro_Jmp:
case iro_Break:
return 1;
-#ifndef SCHEDULE_PROJS
case iro_Proj:
return 0;
-#endif
default:
return is_data_node(irn);
}
sched_info_t *info = get_irn_sched_info(irn);
assert(_sched_is_scheduled(before));
assert(!_sched_is_scheduled(irn));
-#ifndef SCHEDULE_PROJS
assert(!is_Proj(irn));
-#endif
list_add_tail(&info->list, &get_irn_sched_info(before)->list);
_sched_set_time_stamp(irn);
info->scheduled = 1;
sched_info_t *info = get_irn_sched_info(irn);
assert(_sched_is_scheduled(after));
assert(!_sched_is_scheduled(irn));
-#ifndef SCHEDULE_PROJS
assert(!is_Proj(irn));
-#endif
list_add(&info->list, &get_irn_sched_info(after)->list);
_sched_set_time_stamp(irn);
info->scheduled = 1;
DBG((dbg, LEVEL_1, "Insert remat %+F of %+F before reloader %+F\n", res, spilled, reloader));
-#ifdef SCHEDULE_PROJS
- /* insert in schedule */
- sched_reset(res);
- sched_add_before(reloader, res);
-#ifdef FIRM_STATISTICS
- if (! is_Proj(res))
- env->remat_count++;
-#endif
-#else
if (! is_Proj(res)) {
/* insert in schedule */
sched_reset(res);
env->remat_count++;
#endif
}
-#endif /* SCHEDULE_PROJS */
return res;
}
pp->proj = proj;
assert(get_reg(pp->arg));
set_reg(proj, get_reg(pp->arg));
-#ifdef SCHEDULE_PROJS
- sched_add_after(insert_after, proj);
-#endif
insert_after = proj;
DBG((dbg, LEVEL_2, "Copy register assignment %s from %+F to %+F\n", get_reg(pp->arg)->name, pp->arg, pp->proj));
}
*/
static int sched_edge_hook(FILE *F, ir_node *irn)
{
-#ifndef SCHEDULE_PROJS
if (is_Proj(irn))
return 1;
-#endif
- if(sched_is_scheduled(irn) && sched_has_prev(irn)) {
+ if (sched_is_scheduled(irn) && sched_has_prev(irn)) {
ir_node *prev = sched_prev(irn);
fprintf(F, "edge:{sourcename:\"");
PRINT_NODEID(irn);
env->problem_found = 1;
}
-#ifdef SCHEDULE_PROJS
- /* check that all projs/keeps are behind their nodes */
- if(is_Proj(node)) {
- ir_node *prev = sched_prev(node);
- while(is_Proj(prev))
- prev = sched_prev(prev);
- if(get_Proj_pred(node) != prev) {
- ir_fprintf(stderr, "%+F not scheduled after its pred node in block %+F (%s)\n",
- node, block, get_irg_dump_name(env->irg));
- env->problem_found = 1;
- }
- }
-#endif
if(be_is_Keep(node)) {
/* at least 1 of the keep arguments has to be it schedule
* predecessor */
if (sched_point) {
sched_add_after(sched_point, new_op);
-#ifdef SCHEDULE_PROJS
- sched_add_after(new_op, proj);
-#endif
sched_remove(node);
}
sched_add_before(before, load);
load_res = new_r_Proj(irg, block, load, mode_Iu, pn_ia32_Load_res);
-#ifdef SCHEDULE_PROJS
- sched_add_before(before, load_res);
-#endif
/* TODO: make the actual mode configurable in ChangeCW... */
or = new_rd_ia32_Or(NULL, irg, block, noreg, noreg, load_res, noreg,
// create stackpointer proj
curr_sp = new_r_Proj(irg, block, push, spmode, pn_ia32_Push_stack);
arch_set_irn_register(cg->arch_env, curr_sp, spreg);
-#ifdef SCHEDULE_PROJS
- sched_add_before(irn, curr_sp);
-#endif
+
// create memory proj
mem_proj = new_r_Proj(irg, block, push, mode_M, pn_ia32_Push_M);
set_Proj_pred(mem_proj, irn);
set_Proj_proj(mem_proj, 1);
-
-#ifdef SCHEDULE_PROJS
- if(sched_is_scheduled(irn)) {
- sched_add_after(irn, res_proj);
- sched_add_after(irn, mem_proj);
- }
-#endif
}
try_kill(load);
const arch_register_class_t *cls = &ia32_reg_classes[CLASS_ia32_vfp];
const arch_env_t *arch_env = sim->arch_env;
-#ifndef SCHEDULE_PROJS
if (get_irn_mode(irn) == mode_T) {
const ir_edge_t *edge;
}
}
}
-#endif
if (arch_irn_consider_in_reg_alloc(arch_env, cls, irn)) {
const arch_register_t *reg = x87_get_irn_register(sim, irn);