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

avoid macros in irdump interface

parent 71eed76d
libFirm 1.19.0 (2011-03-15)
---------------------------
......
......@@ -56,11 +56,11 @@ static void dump_ifg_edges(FILE *F, const be_ifg_t *ifg)
if (get_irn_node_nr(node) >= get_irn_node_nr(neighbour))
continue;
fprintf(F, "edge: {sourcename: \"");
PRINT_NODEID(node);
fprintf(F, "\" targetname: \"");
PRINT_NODEID(neighbour);
fprintf(F, "\" arrowstyle:none class:1}\n");
fprintf(F, "edge: {sourcename: ");
print_nodeid(F, node);
fprintf(F, " targetname: ");
print_nodeid(F, neighbour);
fprintf(F, " arrowstyle:none class:1}\n");
}
}
}
......@@ -93,11 +93,11 @@ static void dump_affinity_edges(FILE *F, const copy_opt_t *co,
if (get_irn_node_nr(a->irn) >= get_irn_node_nr(n->irn))
continue;
fprintf(F, "edge: {sourcename: \"");
PRINT_NODEID(a->irn);
fprintf(F, "\" targetname: \"");
PRINT_NODEID(n->irn);
fprintf(F, "\" arrowstyle:none");
fprintf(F, "edge: {sourcename: ");
print_nodeid(F, a->irn);
fprintf(F, " targetname: ");
print_nodeid(F, n->irn);
fprintf(F, " arrowstyle:none");
if (dump_costs)
fprintf(F, " label:\"%d\"", n->costs);
......
......@@ -156,11 +156,11 @@ static void sched_edge_hook(FILE *F, const ir_node *irn)
if (sched_is_scheduled(irn) && sched_has_prev(irn)) {
ir_node *prev = sched_prev(irn);
fprintf(F, "edge:{sourcename:\"");
PRINT_NODEID(irn);
fprintf(F, "\" targetname:\"");
PRINT_NODEID(prev);
fprintf(F, "\" color:magenta}\n");
fprintf(F, "edge:{sourcename: ");
print_nodeid(F, irn);
fprintf(F, " targetname: ");
print_nodeid(F, prev);
fprintf(F, " color:magenta}\n");
}
}
......
......@@ -1245,6 +1245,13 @@ static void solve_lpp(ir_nodeset_t *live_nodes, ir_node *node,
lpp_free(lpp);
}
static bool is_aligned(unsigned num, unsigned alignment)
{
unsigned mask = alignment-1;
assert(is_po2(alignment));
return (num&mask) == 0;
}
/**
* Enforce constraints at a node by live range splits.
*
......@@ -1264,7 +1271,8 @@ static void enforce_constraints(ir_nodeset_t *live_nodes, ir_node *node,
/* construct a list of register occupied by live-through values */
unsigned *live_through_regs = NULL;
/* see if any use constraints are not met */
/* see if any use constraints are not met and whether double-width
* values are involved */
bool double_width = false;
bool good = true;
for (i = 0; i < arity; ++i) {
......@@ -1281,16 +1289,22 @@ static void enforce_constraints(ir_nodeset_t *live_nodes, ir_node *node,
req = arch_get_irn_register_req_in(node, i);
if (req->width > 1)
double_width = true;
reg = arch_get_irn_register(op);
reg_index = arch_register_get_index(reg);
if (req->type & arch_register_req_type_aligned) {
if (!is_aligned(reg_index, req->width)) {
good = false;
continue;
}
}
if (!(req->type & arch_register_req_type_limited))
continue;
limited = req->limited;
reg = arch_get_irn_register(op);
reg_index = arch_register_get_index(reg);
if (!rbitset_is_set(limited, reg_index)) {
/* found an assignment outside the limited set */
good = false;
break;
continue;
}
}
......
This diff is collapsed.
......@@ -130,15 +130,11 @@ typedef enum {
#define TYPE_MEMBER_EDGE_ATTR "class: 12 label: \"member\" color:blue"
/* #define CALLGRAPH_EDGE_ATTR "calls" */
#define PRINT_NODEID(X) ir_fprintf(F, "n%ld", get_irn_node_nr(X))
#define PRINT_TYPEID(X) ir_fprintf(F, "\"t%ld\"", get_type_nr(X))
#define PRINT_ENTID(X) ir_fprintf(F, "e%ld", get_entity_nr(X))
#define PRINT_IRGID(X) ir_fprintf(F, "g%ld", get_irg_graph_nr(X))
#define PRINT_CONSTID(X,Y) ir_fprintf(F, "\"n%ldn%ld\"", get_irn_node_nr(X),get_irn_node_nr(Y))
#define PRINT_CONSTBLKID(X,Y) ir_fprintf(F, "n%ldb%ld", get_irn_node_nr(X),get_irn_node_nr(Y))
#define PRINT_LOOPID(X) ir_fprintf(F, "l%ld", get_loop_loop_nr(X))
#define PRINT_ITEMID(X,Y) ir_fprintf(F, "i%ldT%zu", get_type_nr(X), (Y))
#define PRINT_EXTBBID(X) ir_fprintf(F, "x%ld", get_irn_node_nr(X))
void print_nodeid(FILE *F, const ir_node *node);
void print_irgid(FILE *F, const ir_graph *irg);
void print_typeid(FILE *F, const ir_type *type);
void print_entityid(FILE *F, const ir_entity *entity);
void print_loopid(FILE *F, const ir_loop *loop);
const char *get_irg_dump_name(const ir_graph *irg);
......
Supports Markdown
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