Commit 80942539 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

be: Dump registers and requirements of all middle-end nodes, not just Phis.

parent de18eba2
......@@ -120,22 +120,24 @@ static void init_walker(ir_node *node, void *data)
}
static bool initialized = false;
static hook_entry_t hook_liveness_info;
static hook_entry_t hook_backend_info;
static void dump_liveness_info_hook(void *context, FILE *F, const ir_node *node)
static void dump_backend_info_hook(void *context, FILE *F, const ir_node *node)
{
(void)context;
if (!is_Block(node))
return;
ir_graph *irg = get_irn_irg(node);
ir_graph *const irg = get_irn_irg(node);
if (!irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_BACKEND))
return;
be_lv_t *lv = be_get_irg_liveness(irg);
if (!lv->sets_valid)
return;
if (!is_Proj(node))
be_dump_reqs_and_registers(F, node);
be_dump_liveness_block(lv, F, node);
if (is_Block(node)) {
be_lv_t *const lv = be_get_irg_liveness(irg);
if (lv->sets_valid)
be_dump_liveness_block(lv, F, node);
}
}
void be_info_init(void)
......@@ -147,12 +149,8 @@ void be_info_init(void)
set_op_copy_attr(op_Phi, new_phi_copy_attr);
initialized = true;
/* phis have register and register requirements now which we want to dump */
assert(op_Phi->ops.dump_node == NULL);
set_op_dump(op_Phi, be_dump_phi_reg_reqs);
hook_liveness_info.hook._hook_node_info = dump_liveness_info_hook;
register_hook(hook_node_info, &hook_liveness_info);
hook_backend_info.hook._hook_node_info = dump_backend_info_hook;
register_hook(hook_node_info, &hook_backend_info);
}
/**
......@@ -194,8 +192,5 @@ void be_info_free(void)
op_Phi->ops.copy_attr = old_phi_copy_attr;
initialized = false;
assert(op_Phi->ops.dump_node == be_dump_phi_reg_reqs);
set_op_dump(op_Phi, NULL);
unregister_hook(hook_node_info, &hook_liveness_info);
unregister_hook(hook_node_info, &hook_backend_info);
}
......@@ -479,27 +479,6 @@ 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)
{
switch (reason) {
case dump_node_opcode_txt:
fputs(get_irn_opname(node), F);
break;
case dump_node_mode_txt:
fprintf(F, "%s", get_mode_name(get_irn_mode(node)));
break;
case dump_node_nodeattr_txt:
break;
case dump_node_info_txt: {
ir_graph *irg = get_irn_irg(node);
if (irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_BACKEND)) {
be_dump_reqs_and_registers(F, node);
}
break;
}
}
}
ir_node *be_new_Asm(dbg_info *const dbgi, ir_node *const block, int const n_ins, ir_node **const ins, int const n_outs, ident *const text, void *const operands)
{
ir_graph *const irg = get_irn_irg(block);
......
......@@ -162,8 +162,6 @@ const arch_register_req_t *be_create_reg_req(struct obstack *obst,
*/
void be_set_phi_reg_req(ir_node *phi, const arch_register_req_t *req);
void be_dump_phi_reg_reqs(FILE *out, const ir_node *node, dump_reason_t reason);
/**
* Creates a new phi with associated backend informations
*/
......
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