Commit 9a1c04e0 authored by Matthias Braun's avatar Matthias Braun
Browse files

make schedule dumper more robust/cleanup

parent 1376e7ac
......@@ -176,23 +176,26 @@ void be_info_init(void)
*/
static void sched_edge_hook(FILE *F, const ir_node *irn)
{
if (get_irn_irg(irn)->be_data == NULL)
ir_graph *irg = get_irn_irg(irn);
if (!irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_BACKEND))
return;
if (is_Proj(irn) || is_Block(irn) || !sched_is_scheduled(irn))
return;
if (!is_Proj(irn) && sched_is_scheduled(irn) && !is_Block(irn)) {
ir_node *const prev = sched_prev(irn);
if (!sched_is_begin(prev)) {
fprintf(F, "edge:{sourcename: ");
print_nodeid(F, irn);
fprintf(F, " targetname: ");
print_nodeid(F, prev);
fprintf(F, " color:magenta}\n");
}
ir_node *const prev = sched_prev(irn);
if (!sched_is_begin(prev)) {
fprintf(F, "edge:{sourcename: ");
print_nodeid(F, irn);
fprintf(F, " targetname: ");
print_nodeid(F, prev);
fprintf(F, " color:magenta}\n");
}
}
void be_info_init_irg(ir_graph *irg)
{
add_irg_constraints(irg, IR_GRAPH_CONSTRAINT_BACKEND);
irg_walk_anchors(irg, init_walker, NULL, NULL);
set_dump_node_edge_hook(sched_edge_hook);
......
......@@ -480,7 +480,6 @@ static void initialize_birg(be_irg_t *birg, ir_graph *irg, be_main_env_t *env)
/* Ensure, that the ir_edges are computed. */
assure_edges(irg);
add_irg_constraints(irg, IR_GRAPH_CONSTRAINT_BACKEND);
be_info_init_irg(irg);
dump(DUMP_INITIAL, irg, "prepared");
......
......@@ -1076,6 +1076,10 @@ void be_set_phi_reg_req(ir_node *node, const arch_register_req_t *req)
void be_dump_phi_reg_reqs(FILE *F, const ir_node *node, dump_reason_t reason)
{
ir_graph *irg = get_irn_irg(node);
if (!irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_BACKEND))
return;
switch (reason) {
case dump_node_opcode_txt:
fputs(get_op_name(get_irn_op(node)), F);
......@@ -1086,13 +1090,8 @@ void be_dump_phi_reg_reqs(FILE *F, const ir_node *node, dump_reason_t reason)
case dump_node_nodeattr_txt:
break;
case dump_node_info_txt:
{
backend_info_t *info = be_get_info(node);
if (info != NULL && info->out_infos[0].req != NULL) {
arch_dump_reqs_and_registers(F, node);
}
arch_dump_reqs_and_registers(F, node);
break;
}
default:
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment