#include "becopystat.h"
#include "becopyopt.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "bemodule.h"
/** Defines values for the ifg performance test */
{
coloring_t *coloring = c;
const arch_register_t *reg = phase_get_irn_data(&coloring->ph, irn);
- if(reg)
+ if (reg)
arch_set_irn_register(irn, reg);
}
be_ifg_foreach_neighbour(ifg, iter, irn, curr)
neighbours[i++] = curr;
- for(i = 0; i < degree; ++i) {
- for(j = 0; j < i; ++j)
- if(!be_ifg_connected(ifg, neighbours[i], neighbours[j])) {
+ for (i = 0; i < degree; ++i) {
+ for (j = 0; j < i; ++j)
+ if (!be_ifg_connected(ifg, neighbours[i], neighbours[j])) {
free(neighbours);
return 0;
}
{
ir_printf("%+F; ", m);
neighbours_count++;
- if(!be_ifg_connected(ifg, n, m))
+ if (!be_ifg_connected(ifg, n, m))
ir_fprintf(stderr, "%+F is a neighbour of %+F but they are not connected!\n", n, m);
}
}
be_ifg_foreach_node(ifg, iter1, n)
{
- if(!node_is_in_irgs_storage(ifg->env->irg, n))
+ if (!node_is_in_irgs_storage(ifg->env->irg, n))
{
ir_printf("+%F is in ifg but not in the current irg!", n);
assert (node_is_in_irgs_storage(ifg->env->irg, n));
ir_printf("%d. %+F's neighbours(%d): ", i+1, all_nodes[i], degree);
- for(k = 0; k < j; k++)
+ for (k = 0; k < j; k++)
{
ir_printf("%+F, ", neighbours[k]);
}
be_ifg_foreach_node(ifg, iter1, n)
{
- if(!node_is_in_irgs_storage(ifg->env->irg, n))
+ if (!node_is_in_irgs_storage(ifg->env->irg, n))
{
ir_fprintf (f,"+%F is in ifg but not in the current irg!",n);
assert (node_is_in_irgs_storage(ifg->env->irg, n));
ir_fprintf (f,"%d. %+F's neighbours(%d): ", i+1, all_nodes[i], degree);
- for(k = 0; k < j; k++)
+ for (k = 0; k < j; k++)
{
ir_fprintf (f,"%+F, ", neighbours[k]);
}
copy_opt_t *co;
be_ifg_t *old_if = chordal_env->ifg;
- ir_timer_t *timer = ir_timer_register("getTime","get Time of copy minimization using the ifg");
+ ir_timer_t *timer = ir_timer_new();
unsigned long elapsed_usec = 0;
if (get_irg_estimated_node_cnt(chordal_env->irg) >= BE_CH_PERFORMANCETEST_MIN_NODES)
}
chordal_env->ifg = old_if;
+
+ ir_timer_free(timer);
}
void be_ifg_dump_dot(be_ifg_t *ifg, ir_graph *irg, FILE *file, const be_ifg_dump_dot_cb_t *cb, void *self)
ir_node *n, *m;
fprintf(file, "graph G {\n\tgraph [");
- if(cb->graph_attr)
+ if (cb->graph_attr)
cb->graph_attr(file, self);
fprintf(file, "];\n");
- if(cb->at_begin)
+ if (cb->at_begin)
cb->at_begin(file, self);
be_ifg_foreach_node(ifg, nodes_it, n) {
- if(cb->is_dump_node && cb->is_dump_node(self, n)) {
+ if (cb->is_dump_node && cb->is_dump_node(self, n)) {
int idx = get_irn_idx(n);
bitset_set(nodes, idx);
fprintf(file, "\tnode [");
- if(cb->node_attr)
+ if (cb->node_attr)
cb->node_attr(file, self, n);
fprintf(file, "]; n%d;\n", idx);
}
int n_idx = get_irn_idx(n);
int m_idx = get_irn_idx(m);
- if(n_idx < m_idx && bitset_is_set(nodes, n_idx) && bitset_is_set(nodes, m_idx)) {
+ if (n_idx < m_idx && bitset_is_set(nodes, n_idx) && bitset_is_set(nodes, m_idx)) {
fprintf(file, "\tn%d -- n%d [", n_idx, m_idx);
- if(cb->edge_attr)
+ if (cb->edge_attr)
cb->edge_attr(file, self, n, m);
fprintf(file, "];\n");
}
}
}
- if(cb->at_end)
+ if (cb->at_end)
cb->at_end(file, self);
fprintf(file, "}\n");
ir_node *m;
be_ifg_foreach_neighbour(ifg, neigh_it, n, m) {
- if (!bitset_contains_irn(seen, m) && !arch_irn_is(m, ignore)) {
- bitset_add_irn(seen, m);
- int_comp_rec(ifg, m, seen);
- }
+ if (bitset_contains_irn(seen, m))
+ continue;
+
+ if (arch_get_register_req_out(m)->type & arch_register_req_type_ignore)
+ continue;
+
+ bitset_add_irn(seen, m);
+ int_comp_rec(ifg, m, seen);
}
}
ir_node *n;
be_ifg_foreach_node(ifg, nodes_it, n) {
- if (!bitset_contains_irn(seen, n) && !arch_irn_is(n, ignore)) {
- ++n_comp;
- bitset_add_irn(seen, n);
- int_comp_rec(ifg, n, seen);
- }
+ if (bitset_contains_irn(seen, n))
+ continue;
+
+ if (arch_get_register_req_out(n)->type & arch_register_req_type_ignore)
+ continue;
+
+ ++n_comp;
+ bitset_add_irn(seen, n);
+ int_comp_rec(ifg, n, seen);
}
free(seen);
ir_snprintf(buf, sizeof(buf), "%s%F_%s.log", prefix, env->irg, env->cls->name);
result = fopen(buf, "wt");
- if(result == NULL) {
+ if (result == NULL) {
panic("Couldn't open '%s' for writing.", buf);
}