libFirm
irdom.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5 
13 #ifndef FIRM_ANA_IRDOM_H
14 #define FIRM_ANA_IRDOM_H
15 
16 #include "firm_types.h"
17 #include "begin.h"
18 
37 FIRM_API ir_node *get_Block_idom(const ir_node *block);
38 
40 FIRM_API ir_node *get_Block_ipostdom(const ir_node *block);
41 
50 FIRM_API int block_dominates(const ir_node *a, const ir_node *b);
51 
60 FIRM_API int block_postdominates(const ir_node *a, const ir_node *b);
61 
70 FIRM_API int block_strictly_postdominates(const ir_node *a, const ir_node *b);
71 
83 FIRM_API ir_node *get_Block_dominated_first(const ir_node *block);
87 FIRM_API ir_node *get_Block_postdominated_first(const ir_node *bl);
88 
96 FIRM_API ir_node *get_Block_dominated_next(const ir_node *node);
100 FIRM_API ir_node *get_Block_postdominated_next(const ir_node *node);
101 
108 FIRM_API ir_node *ir_deepest_common_dominator(ir_node *block0, ir_node *block1);
109 
119 FIRM_API void dom_tree_walk(ir_node *n, irg_walk_func *pre,
120  irg_walk_func *post, void *env);
121 
131 FIRM_API void postdom_tree_walk(ir_node *n, irg_walk_func *pre,
132  irg_walk_func *post, void *env);
133 
141 FIRM_API void dom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre,
142  irg_walk_func *post, void *env);
143 
151 FIRM_API void postdom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre,
152  irg_walk_func *post, void *env);
153 
169 FIRM_API void compute_doms(ir_graph *irg);
170 
186 FIRM_API void compute_postdoms(ir_graph *irg);
187 
192 FIRM_API void ir_compute_dominance_frontiers(ir_graph *irg);
193 
200 FIRM_API ir_node **ir_get_dominance_frontier(const ir_node *block);
201 
204 #include "end.h"
205 
206 #endif
int block_strictly_postdominates(const ir_node *a, const ir_node *b)
Check, if a block strictly post dominates another block, i.e.
ir_node * get_Block_postdominated_next(const ir_node *node)
Returns the next node in a list of nodes which are postdominated by another node. ...
int block_postdominates(const ir_node *a, const ir_node *b)
Check, if a block post dominates another block.
ir_node * get_Block_postdominated_first(const ir_node *bl)
Returns the first node in the list of nodes postdominated by a given blcok.
void compute_postdoms(ir_graph *irg)
Computes the post dominance relation for all basic blocks of a given graph.
void ir_compute_dominance_frontiers(ir_graph *irg)
Compute the dominance frontiers for a given graph.
void postdom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env)
Walk over the post dominator tree of an irg starting at the root.
int block_dominates(const ir_node *a, const ir_node *b)
Check, if a block dominates another block.
void compute_doms(ir_graph *irg)
Computes the dominance relation for all basic blocks of a given graph.
ir_node * get_Block_dominated_first(const ir_node *block)
Returns the first node in the list of nodes dominated by a given block.
void irg_walk_func(ir_node *, void *)
type for graph-walk callbacks
Definition: firm_types.h:94
ir_node * get_Block_dominated_next(const ir_node *node)
Returns the next node in a list of nodes which are dominated by some other node.
void dom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env)
Walk over the dominator tree of an irg starting at the root.
ir_node * ir_deepest_common_dominator(ir_node *block0, ir_node *block1)
Returns the deepest common dominator of two blocks.
ir_node * get_Block_idom(const ir_node *block)
return immediate dominator of block
void dom_tree_walk(ir_node *n, irg_walk_func *pre, irg_walk_func *post, void *env)
Visit all nodes in the dominator subtree of a given node.
ir_node * get_Block_ipostdom(const ir_node *block)
return immediate postdominator of a block
void postdom_tree_walk(ir_node *n, irg_walk_func *pre, irg_walk_func *post, void *env)
Visit all nodes in the post dominator subtree of a given node.
struct ir_node ir_node
Procedure Graph Node.
Definition: firm_types.h:53
struct ir_graph ir_graph
Procedure Graph.
Definition: firm_types.h:74
ir_node ** ir_get_dominance_frontier(const ir_node *block)
Get the dominance frontier of a block.