Commit 0b4ffc9e authored by Christoph Mallon's avatar Christoph Mallon
Browse files

s/irn_not_visited(x)/!irn_visited(x)/.

[r22521]
parent fa9c992b
......@@ -209,8 +209,6 @@ ir_visited_t get_irn_visited(const ir_node *node);
void set_irn_visited(ir_node *node, ir_visited_t visited);
/** Sets visited to get_irg_visited(current_ir_graph). */
void mark_irn_visited(ir_node *node);
/** Returns 1 if visited < get_irg_visited(current_ir_graph). */
int irn_not_visited(const ir_node *node);
/** Returns 1 if visited >= get_irg_visited(current_ir_graph). */
int irn_visited(const ir_node *node);
......
......@@ -111,7 +111,7 @@ static void pre_walk_calc_extbb(ir_node *block, void *ctx) {
*/
ir_node *cf_op = skip_Proj(get_Block_cfgpred(block, 0));
if (irn_not_visited(cf_op)) {
if (!irn_visited(cf_op)) {
ir_node *pred_bl = get_nodes_block(cf_op);
if (get_block_n_succs(pred_bl) > 2) {
/* More than two successors means we have a jump table.
......
......@@ -316,7 +316,7 @@ static int _count_outs(ir_node *n) {
}
/* count Def-Use edges for predecessors */
if (irn_not_visited(skipped_pred))
if (!irn_visited(skipped_pred))
res += _count_outs(skipped_pred);
/*count my Def-Use edges */
......@@ -340,7 +340,7 @@ static int count_outs(ir_graph *irg) {
even if they are not visible. */
for (i = anchor_last - 1; i >= 0; --i) {
n = get_irg_anchor(irg, i);
if (irn_not_visited(n)) {
if (!irn_visited(n)) {
mark_irn_visited(n);
n->out = INT_TO_PTR(1);
......@@ -382,7 +382,7 @@ static ir_def_use_edge *_set_out_edges(ir_node *use, ir_def_use_edge *free) {
ir_node *def = get_irn_n(use, i);
/* Recursion */
if (irn_not_visited(def))
if (!irn_visited(def))
free = _set_out_edges(def, free);
/* Remember this Def-Use edge */
......@@ -414,7 +414,7 @@ static ir_def_use_edge *set_out_edges(ir_graph *irg, ir_def_use_edge *free) {
/* handle anchored nodes */
for (i = anchor_last - 1; i >= 0; --i) {
n = get_irg_anchor(irg, i);
if (irn_not_visited(n)) {
if (!irn_visited(n)) {
mark_irn_visited(n);
n_outs = PTR_TO_INT(n->out);
......
......@@ -1356,7 +1356,7 @@ static void dump_const_node_local(FILE *F, ir_node *n) {
for (i = 0; i < get_irn_arity(n); i++) {
ir_node *con = get_irn_n(n, i);
if (is_constlike_node(con) && irn_not_visited(con)) {
if (is_constlike_node(con) && !irn_visited(con)) {
int bad = 0;
mark_irn_visited(con);
......
......@@ -545,7 +545,7 @@ typedef struct visitor_info_t {
static void visitor(ir_node *irn, void *data) {
visitor_info_t *info = data;
if (irn_not_visited(irn)) {
if (!irn_visited(irn)) {
mark_irn_visited(irn);
info->visit(irn, info->data);
}
......
......@@ -227,7 +227,7 @@ static void collect_walk(ir_node *node, blk_collect_data_t *env)
ir_node *pred = _get_walk_irn_n(env, node, i);
ir_node *blk = get_nodes_block(pred);
if (irn_not_visited(pred)) {
if (!irn_visited(pred)) {
collect_walk(pred, env);
/* control flow predecessors are always block inputs */
......@@ -250,14 +250,14 @@ static void collect_walk(ir_node *node, blk_collect_data_t *env)
else {
block = get_nodes_block(node);
if (irn_not_visited(block))
if (!irn_visited(block))
collect_walk(block, env);
is_phi = is_Phi(node);
for (i = _get_walk_arity(env, node) - 1; i >= 0; --i) {
ir_node *pred = _get_walk_irn_n(env, node, i);
if (irn_not_visited(pred)) {
if (!irn_visited(pred)) {
collect_walk(pred, env);
/* BEWARE: predecessors of End nodes might be blocks */
......@@ -302,7 +302,7 @@ static void collect_blks_lists(ir_node *node, ir_node *block,
if (is_no_Block(pred)) {
ir_node *blk = get_nodes_block(pred);
if (irn_not_visited(pred)) {
if (!irn_visited(pred)) {
if (block != blk)
continue;
collect_blks_lists(pred, block, entry, env);
......
......@@ -457,10 +457,6 @@ void (mark_irn_visited)(ir_node *node) {
_mark_irn_visited(node);
}
int (irn_not_visited)(const ir_node *node) {
return _irn_not_visited(node);
}
int (irn_visited)(const ir_node *node) {
return _irn_visited(node);
}
......
......@@ -342,16 +342,6 @@ _irn_visited(const ir_node *node) {
return (node->visited >= current_ir_graph->visited);
}
/**
* Returns non-zero if a node of was NOT visited.
* Intern version for libFirm.
*/
static INLINE int
_irn_not_visited(const ir_node *node) {
assert(node);
return (node->visited < current_ir_graph->visited);
}
/**
* Sets the link of a node.
* Intern version of libFirm.
......@@ -1023,7 +1013,6 @@ _is_arg_Proj(const ir_node *node) {
#define set_irn_visited(node, v) _set_irn_visited(node, v)
#define mark_irn_visited(node) _mark_irn_visited(node)
#define irn_visited(node) _irn_visited(node)
#define irn_not_visited(node) _irn_not_visited(node)
#define set_irn_link(node, link) _set_irn_link(node, link)
#define get_irn_link(node) _get_irn_link(node)
#define get_irn_pinned(node) _get_irn_pinned(node)
......
......@@ -165,7 +165,7 @@ static void merge_blocks(ir_node *node, void *ctx) {
if (!is_Block_dead(b)) {
new_block = equivalent_node(b);
while (irn_not_visited(b) && (!is_Block_dead(new_block)) && (new_block != b)) {
while (!irn_visited(b) && !is_Block_dead(new_block) && new_block != b) {
/* We would have to run gigo() if new is bad, so we
promote it directly below. Nevertheless, we sometimes reach a block
the first time through a dataflow node. In this case we optimized the
......@@ -787,7 +787,7 @@ restart:
for (i = j = 0; i < n; i++) {
ir_node *ka = get_End_keepalive(end, i);
if (irn_not_visited(ka)) {
if (!irn_visited(ka)) {
if (is_Block(ka) && !Block_block_visited(ka)) {
/* irg_block_walk() will increase the block visited flag, but we must visit only
these blocks that are not visited yet, so decrease it first. */
......
......@@ -68,7 +68,7 @@ place_floats_early(ir_node *n, waitq *worklist) {
int i, irn_arity;
/* we must not run into an infinite loop */
assert(irn_not_visited(n));
assert(!irn_visited(n));
mark_irn_visited(n);
/* Place floating nodes. */
......@@ -92,7 +92,7 @@ place_floats_early(ir_node *n, waitq *worklist) {
ir_node *pred = get_irn_n(n, i);
ir_node *pred_block;
if ((irn_not_visited(pred))
if (!irn_visited(pred)
&& (get_irn_pinned(pred) == op_pin_state_floats)) {
/*
......@@ -154,7 +154,7 @@ place_floats_early(ir_node *n, waitq *worklist) {
*/
for (i = -1; i < irn_arity; ++i) {
ir_node *pred = get_irn_n(n, i);
if (irn_not_visited(pred))
if (!irn_visited(pred))
waitq_put(worklist, pred);
}
} else if (is_Block(n)) {
......@@ -164,7 +164,7 @@ place_floats_early(ir_node *n, waitq *worklist) {
*/
for (i = irn_arity - 1; i >= 0; --i) {
ir_node *pred = get_irn_n(n, i);
if (irn_not_visited(pred))
if (!irn_visited(pred))
waitq_put(worklist, pred);
}
} else if (is_Phi(n)) {
......@@ -177,13 +177,13 @@ place_floats_early(ir_node *n, waitq *worklist) {
* of the Phi-input if the Phi is not in a bad block.
*/
pred = get_nodes_block(n);
if (irn_not_visited(pred))
if (!irn_visited(pred))
waitq_put(worklist, pred);
for (i = irn_arity - 1; i >= 0; --i) {
ir_node *pred = get_irn_n(n, i);
if (irn_not_visited(pred)) {
if (!irn_visited(pred)) {
if (! in_dead_block &&
get_irn_pinned(pred) == op_pin_state_floats &&
is_Block_unreachable(get_nodes_block(pred))) {
......@@ -201,13 +201,13 @@ place_floats_early(ir_node *n, waitq *worklist) {
* All other nodes: move nodes from dead blocks into the same block.
*/
pred = get_nodes_block(n);
if (irn_not_visited(pred))
if (!irn_visited(pred))
waitq_put(worklist, pred);
for (i = irn_arity - 1; i >= 0; --i) {
ir_node *pred = get_irn_n(n, i);
if (irn_not_visited(pred)) {
if (!irn_visited(pred)) {
if (! in_dead_block &&
get_irn_pinned(pred) == op_pin_state_floats &&
is_Block_unreachable(get_nodes_block(pred))) {
......@@ -237,7 +237,7 @@ static void place_early(waitq *worklist) {
/* Work the content of the worklist. */
while (!waitq_empty(worklist)) {
ir_node *n = waitq_get(worklist);
if (irn_not_visited(n))
if (!irn_visited(n))
place_floats_early(n, worklist);
}
set_irg_pinned(current_ir_graph, op_pin_state_pinned);
......@@ -417,7 +417,7 @@ static void place_floats_late(ir_node *n, pdeq *worklist) {
int i, n_outs;
ir_node *early_blk;
assert(irn_not_visited(n)); /* no multiple placement */
assert(!irn_visited(n)); /* no multiple placement */
mark_irn_visited(n);
......@@ -445,7 +445,7 @@ static void place_floats_late(ir_node *n, pdeq *worklist) {
producer of one of their inputs in the same block anyway. */
for (i = get_irn_n_outs(n) - 1; i >= 0; --i) {
ir_node *succ = get_irn_out(n, i);
if (irn_not_visited(succ) && !is_Phi(succ))
if (!irn_visited(succ) && !is_Phi(succ))
place_floats_late(succ, worklist);
}
......@@ -480,7 +480,7 @@ static void place_floats_late(ir_node *n, pdeq *worklist) {
n_outs = get_irn_n_outs(n);
for (i = 0; i < n_outs; i++) {
ir_node *succ = get_irn_out(n, i);
if (irn_not_visited(succ)) {
if (!irn_visited(succ)) {
pdeq_putr(worklist, succ);
}
}
......@@ -502,7 +502,7 @@ static void place_late(waitq *worklist) {
/* And now empty the worklist again... */
while (!waitq_empty(worklist)) {
ir_node *n = waitq_get(worklist);
if (irn_not_visited(n))
if (!irn_visited(n))
place_floats_late(n, worklist);
}
}
......
......@@ -2080,7 +2080,7 @@ static void dfs(ir_node *irn, loop_env *env)
ir_node *pred = get_irn_n(irn, i);
node_entry *o = get_irn_ne(pred, env);
if (irn_not_visited(pred)) {
if (!irn_visited(pred)) {
dfs(pred, env);
node->low = MIN(node->low, o->low);
}
......@@ -2091,7 +2091,7 @@ static void dfs(ir_node *irn, loop_env *env)
ir_node *pred = get_fragile_op_mem(irn);
node_entry *o = get_irn_ne(pred, env);
if (irn_not_visited(pred)) {
if (!irn_visited(pred)) {
dfs(pred, env);
node->low = MIN(node->low, o->low);
}
......@@ -2101,7 +2101,7 @@ static void dfs(ir_node *irn, loop_env *env)
ir_node *pred = get_Proj_pred(irn);
node_entry *o = get_irn_ne(pred, env);
if (irn_not_visited(pred)) {
if (!irn_visited(pred)) {
dfs(pred, env);
node->low = MIN(node->low, o->low);
}
......@@ -2167,7 +2167,7 @@ static void do_dfs(ir_graph *irg, loop_env *env) {
for (i = get_End_n_keepalives(end) - 1; i >= 0; --i) {
ir_node *ka = get_End_keepalive(end, i);
if (is_Phi(ka) && irn_not_visited(ka))
if (is_Phi(ka) && !irn_visited(ka))
dfs(ka, env);
}
current_ir_graph = rem;
......
......@@ -939,7 +939,7 @@ static void dfs(ir_node *irn, iv_env *env)
for (i = 0; i < n; ++i) {
ir_node *pred = get_irn_n(irn, i);
if (irn_not_visited(pred))
if (!irn_visited(pred))
dfs(pred, env);
}
}
......@@ -951,7 +951,7 @@ static void dfs(ir_node *irn, iv_env *env)
push(env, irn);
/* handle the block */
if (irn_not_visited(block))
if (!irn_visited(block))
dfs(block, env);
n = get_irn_arity(irn);
......@@ -959,7 +959,7 @@ static void dfs(ir_node *irn, iv_env *env)
ir_node *pred = get_irn_n(irn, i);
node_entry *o = get_irn_ne(pred, env);
if (irn_not_visited(pred)) {
if (!irn_visited(pred)) {
dfs(pred, env);
node->low = MIN(node->low, o->low);
}
......@@ -1010,7 +1010,7 @@ static void do_dfs(ir_graph *irg, iv_env *env) {
for (i = 0; i < n; ++i) {
ir_node *ka = get_End_keepalive(end, i);
if (irn_not_visited(ka))
if (!irn_visited(ka))
dfs(ka, env);
}
......
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