case iro_End:
case iro_NoMem:
case iro_Bad:
+ case iro_Unknown:
return 0;
default:
break;
typedef struct _spill_t {
ir_node *spill;
- entity *ent;
+ ir_entity *ent;
} spill_t;
typedef struct {
return set_find(env->spills, &spill, sizeof(spill), HASH_PTR(node));
}
-static spill_t *get_spill(be_verify_spillslots_env_t *env, ir_node *node, entity *ent) {
+static spill_t *get_spill(be_verify_spillslots_env_t *env, ir_node *node, ir_entity *ent) {
spill_t spill, *res;
int hash = HASH_PTR(node);
return result;
}
-static void collect(be_verify_spillslots_env_t *env, ir_node *node, ir_node *reload, entity* ent);
+static void collect(be_verify_spillslots_env_t *env, ir_node *node, ir_node *reload, ir_entity* ent);
-static void check_entity(be_verify_spillslots_env_t *env, ir_node *node, entity *ent) {
+static void check_entity(be_verify_spillslots_env_t *env, ir_node *node, ir_entity *ent) {
if(ent == NULL) {
ir_fprintf(stderr, "Verify warning: Node %+F in block %+F(%s) should have an entity assigned\n",
node, get_nodes_block(node), get_irg_dump_name(env->irg));
}
}
-static void collect_spill(be_verify_spillslots_env_t *env, ir_node *node, ir_node *reload, entity* ent) {
- entity *spillent = arch_get_frame_entity(env->arch_env, node);
+static void collect_spill(be_verify_spillslots_env_t *env, ir_node *node, ir_node *reload, ir_entity* ent) {
+ ir_entity *spillent = arch_get_frame_entity(env->arch_env, node);
check_entity(env, node, spillent);
get_spill(env, node, ent);
}
}
-static void collect_memperm(be_verify_spillslots_env_t *env, ir_node *node, ir_node *reload, entity* ent) {
+static void collect_memperm(be_verify_spillslots_env_t *env, ir_node *node, ir_node *reload, ir_entity* ent) {
int i, arity;
spill_t spill, *res;
int hash = HASH_PTR(node);
int out;
ir_node* memperm;
- entity *spillent;
+ ir_entity *spillent;
assert(is_Proj(node));
for(i = 0, arity = be_get_MemPerm_entity_arity(memperm); i < arity; ++i) {
ir_node* arg = get_irn_n(memperm, i + 1);
- entity* argent = be_get_MemPerm_in_entity(memperm, i);
+ ir_entity* argent = be_get_MemPerm_in_entity(memperm, i);
collect(env, arg, memperm, argent);
}
}
-static void collect_memphi(be_verify_spillslots_env_t *env, ir_node *node, ir_node *reload, entity *ent) {
+static void collect_memphi(be_verify_spillslots_env_t *env, ir_node *node, ir_node *reload, ir_entity *ent) {
int i, arity;
spill_t spill, *res;
int hash = HASH_PTR(node);
}
}
-static void collect(be_verify_spillslots_env_t *env, ir_node *node, ir_node *reload, entity* ent) {
+static void collect(be_verify_spillslots_env_t *env, ir_node *node, ir_node *reload, ir_entity* ent) {
if(be_is_Spill(node)) {
collect_spill(env, node, reload, ent);
} else if(is_Proj(node)) {
if(arch_irn_class_is(arch_env, node, reload)) {
ir_node *spill = get_memory_edge(node);
- entity *ent;
+ ir_entity *ent;
if(spill == NULL) {
ir_fprintf(stderr, "Verify warning: No spill attached to reload %+F in block %+F(%s)\n",
if(be_is_Spill(node) || (is_Proj(node) && be_is_MemPerm(get_Proj_pred(node)))) {
spill_t *spill = find_spill(env, node);
if(be_is_Spill(node)) {
- entity *ent = arch_get_frame_entity(env->arch_env, node);
+ ir_entity *ent = arch_get_frame_entity(env->arch_env, node);
check_entity(env, node, ent);
}
typedef struct _verify_out_dead_nodes_env {
ir_graph *irg;
bitset_t *reachable;
- bitset_t *visited;
int problem_found;
} verify_out_dead_nodes_env;
static void check_out_edges(ir_node *node, verify_out_dead_nodes_env *env) {
+ ir_graph *irg = env->irg;
const ir_edge_t* edge;
+ if(irn_visited(node))
+ return;
+ mark_irn_visited(node);
+
foreach_out_edge(node, edge) {
ir_node* src = get_edge_src_irn(edge);
if(!bitset_is_set(env->reachable, get_irn_idx(src))) {
- ir_fprintf(stderr, "Verify warning: Node %+F in block %+F(%s) only reachable through out edges from %+F\n",
- src, get_nodes_block(src), get_irg_dump_name(env->irg), node);
- env->problem_found = 1;
+ if(src != get_irg_globals(irg)
+ && src != get_irg_tls(irg)) {
+ ir_fprintf(stderr,
+ "Verify warning: Node %+F in block %+F(%s) only reachable through out edges from %+F\n",
+ src, get_nodes_block(src), get_irg_dump_name(irg), node);
+ env->problem_found = 1;
+ }
+ continue;
}
- if(!bitset_is_set(env->visited, get_irn_idx(src))) {
- bitset_set(env->visited, get_irn_idx(src));
- if(!is_Block(src))
- check_out_edges(src, env);
+ if(!is_Block(src)) {
+ check_out_edges(src, env);
}
}
}
verify_out_dead_nodes_env env;
env.irg = irg;
env.reachable = bitset_alloca(get_irg_last_idx(irg));
- env.visited = bitset_alloca(get_irg_last_idx(irg));
env.problem_found = 0;
irg_walk_graph(irg, set_reachable, NULL, env.reachable);
+ inc_irg_visited(irg);
check_out_edges(get_irg_start(irg), &env);
return !env.problem_found;