Commit c7736470 authored by Matthias Braun's avatar Matthias Braun
Browse files

add some dumping hints to irop flags

[r20597]
parent d9b6d096
......@@ -71,9 +71,11 @@ typedef enum {
irop_flag_keep = 0x00000200, /**< This operation can be kept in End's keep-alive list. */
irop_flag_start_block = 0x00000400, /**< This operation is always placed in the Start block. */
irop_flag_uses_memory = 0x00000800, /**< This operation has a memory input and may change the memory state. */
irop_flag_machine = 0x00001000, /**< This operation is a machine operation. */
irop_flag_machine_op = 0x00002000, /**< This operation is a machine operand. */
irop_flag_user = 0x00004000 /**< This flag and all higher ones are free for machine user. */
irop_flag_dump_noblock = 0x00001000, /**< node should be dumped outside any blocks */
irop_flag_dump_noinput = 0x00002000, /**< node is a placeholder for "no input" */
irop_flag_machine = 0x00010000, /**< This operation is a machine operation. */
irop_flag_machine_op = 0x00020000, /**< This operation is a machine operand. */
irop_flag_user = 0x00040000 /**< This flag and all higher ones are free for machine user. */
} irop_flags;
/** The opcodes of the libFirm predefined operations. */
......@@ -250,6 +252,8 @@ op_func get_generic_function_ptr(const ir_op *op);
*/
void set_generic_function_ptr(ir_op *op, op_func func);
irop_flags get_op_flags(const ir_op *op);
/**
* The compute value operation.
* This operation evaluates an IR node into a tarval if possible,
......
......@@ -51,6 +51,8 @@ $arch = "ia32";
# H irop_flag_highlevel
# c irop_flag_constlike
# K irop_flag_keep
# NB irop_flag_dump_noblock
# NI irop_flag_dump_noinput
#
# irn_flags: special node flags, OPTIONAL (default is 0)
# following irn_flags are supported:
......@@ -1178,7 +1180,7 @@ GetEIP => {
Unknown_GP => {
state => "pinned",
op_flags => "c",
op_flags => "c|NB",
irn_flags => "I",
reg_req => { out => [ "gp_UKNWN" ] },
units => [],
......@@ -1189,7 +1191,7 @@ Unknown_GP => {
Unknown_VFP => {
state => "pinned",
op_flags => "c",
op_flags => "c|NB",
irn_flags => "I",
reg_req => { out => [ "vfp_UKNWN" ] },
units => [],
......@@ -1201,7 +1203,7 @@ Unknown_VFP => {
Unknown_XMM => {
state => "pinned",
op_flags => "c",
op_flags => "c|NB",
irn_flags => "I",
reg_req => { out => [ "xmm_UKNWN" ] },
units => [],
......@@ -1212,7 +1214,7 @@ Unknown_XMM => {
NoReg_GP => {
state => "pinned",
op_flags => "c",
op_flags => "c|NB|NI",
irn_flags => "I",
reg_req => { out => [ "gp_NOREG" ] },
units => [],
......@@ -1223,7 +1225,7 @@ NoReg_GP => {
NoReg_VFP => {
state => "pinned",
op_flags => "c",
op_flags => "c|NB|NI",
irn_flags => "I",
reg_req => { out => [ "vfp_NOREG" ] },
units => [],
......@@ -1235,7 +1237,7 @@ NoReg_VFP => {
NoReg_XMM => {
state => "pinned",
op_flags => "c",
op_flags => "c|NB|NI",
irn_flags => "I",
reg_req => { out => [ "xmm_NOREG" ] },
units => [],
......
......@@ -608,9 +608,7 @@ static void collect_node(ir_node * node, void *env) {
(void) env;
if (is_Block(node)
|| node_floats(node)
|| get_irn_op(node) == op_Bad
|| get_irn_op(node) == op_Unknown
|| get_irn_op(node) == op_NoMem) {
|| (get_op_flags(get_irn_op(node)) & irop_flag_dump_noblock)) {
ir_node ** arr = (ir_node **) ird_get_irg_link(get_irn_irg(node));
if (!arr) arr = NEW_ARR_F(ir_node *, 0);
ARR_APP1(ir_node *, arr, node);
......@@ -1445,18 +1443,26 @@ static void dump_node(FILE *F, ir_node *n)
return;
/* dump this node */
fprintf(F, "node: {title: \""); PRINT_NODEID(n); fprintf(F, "\" label: \"");
fputs("node: {title: \"", F);
PRINT_NODEID(n);
fputs("\"", F);
fputs(" label: \"", F);
bad = ! irn_vrfy_irg_dump(n, current_ir_graph, &p);
bad |= dump_node_label(F, n);
dump_node_ana_vals(F, n);
//dump_node_ana_info(F, n);
fprintf(F, "\" ");
fputs("\" ", F);
if (get_op_flags(get_irn_op(n)) & irop_flag_dump_noinput) {
fputs(" node_class:23", F);
}
bad |= dump_node_info(F, n);
print_node_error(F, p);
print_dbg_info(F, get_irn_dbg_info(n));
dump_node_vcgattr(F, n, NULL, bad);
fprintf(F, "}\n");
fputs("}\n", F);
dump_const_node_local(F, n);
if(dump_node_edge_hook)
......@@ -2334,6 +2340,7 @@ void dump_vcg_header(FILE *F, const char *name, const char *layout, const char *
"classname 20: \"Keep Alive\"\n"
"classname 21: \"Out Edges\"\n"
"classname 22: \"Macro Block Edges\"\n"
"classname 23: \"NoInput Nodes\"\n"
"infoname 1: \"Attribute\"\n"
"infoname 2: \"Verification errors\"\n"
"infoname 3: \"Debug info\"\n",
......
......@@ -286,6 +286,8 @@ init_op(void)
#define K irop_flag_keep
#define S irop_flag_start_block
#define M irop_flag_uses_memory
#define NB irop_flag_dump_noblock
#define NI irop_flag_dump_noinput
/* Caution: A great deal of Firm optimizations depend an right operations flags. */
op_Block = new_ir_op(iro_Block, "Block", op_pin_state_pinned, L, oparity_variable, -1, sizeof(block_attr), NULL);
......@@ -329,29 +331,29 @@ init_op(void)
op_Phi = new_ir_op(iro_Phi, "Phi", op_pin_state_pinned, N, oparity_variable, -1, sizeof(phi_attr), NULL);
op_Load = new_ir_op(iro_Load, "Load", op_pin_state_exc_pinned, F|M, oparity_any, -1, sizeof(load_attr), NULL);
op_Store = new_ir_op(iro_Store, "Store", op_pin_state_exc_pinned, F|M, oparity_any, -1, sizeof(store_attr), NULL);
op_Alloc = new_ir_op(iro_Alloc, "Alloc", op_pin_state_pinned, F|M, oparity_any, -1, sizeof(alloc_attr), NULL);
op_Free = new_ir_op(iro_Free, "Free", op_pin_state_pinned, N|M, oparity_any, -1, sizeof(free_attr), NULL);
op_Load = new_ir_op(iro_Load, "Load", op_pin_state_exc_pinned, F|M, oparity_any, -1, sizeof(load_attr), NULL);
op_Store = new_ir_op(iro_Store, "Store", op_pin_state_exc_pinned, F|M, oparity_any, -1, sizeof(store_attr), NULL);
op_Alloc = new_ir_op(iro_Alloc, "Alloc", op_pin_state_pinned, F|M, oparity_any, -1, sizeof(alloc_attr), NULL);
op_Free = new_ir_op(iro_Free, "Free", op_pin_state_pinned, N|M, oparity_any, -1, sizeof(free_attr), NULL);
op_Sync = new_ir_op(iro_Sync, "Sync", op_pin_state_floats, N, oparity_dynamic, -1, 0, NULL);
op_Proj = new_ir_op(iro_Proj, "Proj", op_pin_state_floats, N, oparity_unary, -1, sizeof(long), NULL);
op_Tuple = new_ir_op(iro_Tuple, "Tuple", op_pin_state_floats, L, oparity_variable, -1, 0, NULL);
op_Id = new_ir_op(iro_Id, "Id", op_pin_state_floats, N, oparity_any, -1, 0, NULL);
op_Bad = new_ir_op(iro_Bad, "Bad", op_pin_state_pinned, X|F|S, oparity_zero, -1, 0, NULL);
op_Bad = new_ir_op(iro_Bad, "Bad", op_pin_state_pinned, X|F|S|NB,oparity_zero, -1, 0, NULL);
op_Confirm = new_ir_op(iro_Confirm, "Confirm", op_pin_state_pinned, H, oparity_any, -1, sizeof(confirm_attr), NULL);
op_Unknown = new_ir_op(iro_Unknown, "Unknown", op_pin_state_pinned, X|F|S|c, oparity_zero, -1, 0, NULL);
op_Unknown = new_ir_op(iro_Unknown, "Unknown", op_pin_state_pinned, X|F|S|c|NB,oparity_zero, -1, 0, NULL);
op_Filter = new_ir_op(iro_Filter, "Filter", op_pin_state_pinned, N, oparity_variable, -1, sizeof(filter_attr), NULL);
op_Break = new_ir_op(iro_Break, "Break", op_pin_state_pinned, X, oparity_zero, -1, 0, NULL);
op_CallBegin = new_ir_op(iro_CallBegin, "CallBegin", op_pin_state_pinned, X|I, oparity_any, -1, sizeof(callbegin_attr), NULL);
op_EndReg = new_ir_op(iro_EndReg, "EndReg", op_pin_state_pinned, X|I, oparity_dynamic, -1, 0, NULL);
op_EndExcept = new_ir_op(iro_EndExcept, "EndExcept", op_pin_state_pinned, X|I, oparity_dynamic, -1, 0, NULL);
op_NoMem = new_ir_op(iro_NoMem, "NoMem", op_pin_state_pinned, N, oparity_zero, -1, 0, NULL);
op_NoMem = new_ir_op(iro_NoMem, "NoMem", op_pin_state_pinned, N|NB|NI, oparity_zero, -1, 0, NULL);
op_Mux = new_ir_op(iro_Mux, "Mux", op_pin_state_floats, N, oparity_trinary, -1, 0, NULL);
op_Psi = new_ir_op(iro_Psi, "Psi", op_pin_state_floats, N, oparity_variable, -1, 0, NULL);
op_CopyB = new_ir_op(iro_CopyB, "CopyB", op_pin_state_mem_pinned, F|H|M, oparity_trinary, -1, sizeof(copyb_attr), NULL);
op_CopyB = new_ir_op(iro_CopyB, "CopyB", op_pin_state_mem_pinned, F|H|M, oparity_trinary,-1, sizeof(copyb_attr), NULL);
op_InstOf = new_ir_op(iro_InstOf, "InstOf", op_pin_state_mem_pinned, H, oparity_unary, -1, sizeof(io_attr), NULL);
op_Raise = new_ir_op(iro_Raise, "Raise", op_pin_state_pinned, H|X, oparity_any, -1, 0, NULL);
......@@ -361,7 +363,7 @@ init_op(void)
op_ASM = new_ir_op(iro_ASM, "ASM", op_pin_state_mem_pinned, K|M, oparity_variable, -1, sizeof(asm_attr), NULL);
op_Anchor = new_ir_op(iro_Anchor, "Anchor", op_pin_state_pinned, N, oparity_variable, -1, 0, NULL);
op_Anchor = new_ir_op(iro_Anchor, "Anchor", op_pin_state_pinned, N|NB, oparity_variable, -1, 0, NULL);
#undef S
#undef H
......@@ -372,6 +374,8 @@ init_op(void)
#undef C
#undef L
#undef E
#undef NB
#undef NI
} /* init_op */
......@@ -512,3 +516,7 @@ void (set_generic_function_ptr)(ir_op *op, op_func func) {
const ir_op_ops *(get_op_ops)(const ir_op *op) {
return _get_op_ops(op);
} /* get_op_ops */
irop_flags get_op_flags(const ir_op *op) {
return op->flags;
}
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