projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ia32_Minus64Bit needs no contraint copies.
[libfirm]
/
ir
/
ir
/
irgwalk.c
diff --git
a/ir/ir/irgwalk.c
b/ir/ir/irgwalk.c
index
27ac9cb
..
22feaeb
100644
(file)
--- a/
ir/ir/irgwalk.c
+++ b/
ir/ir/irgwalk.c
@@
-375,33
+375,26
@@
static void irg_block_walk_2(ir_node *node, irg_walk_func *pre,
/* walks only over Block nodes in the graph. Has its own visited
flag, so that it can be interleaved with the other walker. */
/* walks only over Block nodes in the graph. Has its own visited
flag, so that it can be interleaved with the other walker. */
-void irg_block_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env)
+void irg_block_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post,
+ void *env)
{
{
- ir_graph *irg = get_irn_irg(node);
- ir_node *block, *pred;
- int i;
+ ir_graph *irg = get_irn_irg(node);
+ ir_node *block = is_Block(node) ? node : get_nodes_block(node);
hook_irg_block_walk(irg, node, (generic_func *)pre, (generic_func *)post);
hook_irg_block_walk(irg, node, (generic_func *)pre, (generic_func *)post);
- assert(node);
ir_reserve_resources(irg, IR_RESOURCE_BLOCK_VISITED);
inc_irg_block_visited(irg);
ir_reserve_resources(irg, IR_RESOURCE_BLOCK_VISITED);
inc_irg_block_visited(irg);
- block = is_Block(node) ? node : get_nodes_block(node);
- assert(is_Block(block));
irg_block_walk_2(block, pre, post, env);
irg_block_walk_2(block, pre, post, env);
- /*
keepalive: the endless loops ...
*/
+ /*
Some blocks might be only reachable through keep-alive edges
*/
if (is_End(node)) {
int arity = get_irn_arity(node);
if (is_End(node)) {
int arity = get_irn_arity(node);
+ int i;
for (i = 0; i < arity; i++) {
for (i = 0; i < arity; i++) {
- pred = get_irn_n(node, i);
- if (!is_Block(pred)) {
- /* It is sufficient to enter endless loops just at kept blocks, because
- * every endless loop must have one. */
+ ir_node *pred = get_irn_n(node, i);
+ if (!is_Block(pred))
continue;
continue;
- }
- /* Sometimes the blocks died, but are still reachable through kept nodes.
- * Make sure the algorithms that try to remove these reach them. */
irg_block_walk_2(pred, pre, post, env);
}
}
irg_block_walk_2(pred, pre, post, env);
}
}
@@
-429,8
+422,10
@@
void irg_walk_anchors(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, vo
ir_graph * rem = current_ir_graph;
current_ir_graph = irg;
ir_graph * rem = current_ir_graph;
current_ir_graph = irg;
+ ir_reserve_resources(irg, IR_RESOURCE_IRN_VISITED);
inc_irg_visited(irg);
irg_walk_2(irg->anchor, pre, post, env);
inc_irg_visited(irg);
irg_walk_2(irg->anchor, pre, post, env);
+ ir_free_resources(irg, IR_RESOURCE_IRN_VISITED);
current_ir_graph = rem;
}
current_ir_graph = rem;
}