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 
18 #include "begin.h"
19 
38 FIRM_API ir_node *get_Block_idom(const ir_node *block);
39 
41 FIRM_API ir_node *get_Block_ipostdom(const ir_node *block);
42 
44 int get_Block_dom_depth(const ir_node *bl);
45 
47 int get_Block_postdom_depth(const ir_node *bl);
48 
57 FIRM_API int block_dominates(const ir_node *a, const ir_node *b);
58 
67 FIRM_API int block_postdominates(const ir_node *a, const ir_node *b);
68 
77 FIRM_API int block_strictly_postdominates(const ir_node *a, const ir_node *b);
78 
90 FIRM_API ir_node *get_Block_dominated_first(const ir_node *block);
94 FIRM_API ir_node *get_Block_postdominated_first(const ir_node *bl);
95 
103 FIRM_API ir_node *get_Block_dominated_next(const ir_node *node);
107 FIRM_API ir_node *get_Block_postdominated_next(const ir_node *node);
108 
115 FIRM_API ir_node *ir_deepest_common_dominator(ir_node *block0, ir_node *block1);
116 
126 FIRM_API void dom_tree_walk(ir_node *n, irg_walk_func *pre,
127  irg_walk_func *post, void *env);
128 
138 FIRM_API void postdom_tree_walk(ir_node *n, irg_walk_func *pre,
139  irg_walk_func *post, void *env);
140 
148 FIRM_API void dom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre,
149  irg_walk_func *post, void *env);
150 
158 FIRM_API void postdom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre,
159  irg_walk_func *post, void *env);
160 
176 FIRM_API void compute_doms(ir_graph *irg);
177 
193 FIRM_API void compute_postdoms(ir_graph *irg);
194 
199 FIRM_API void ir_compute_dominance_frontiers(ir_graph *irg);
200 
207 FIRM_API ir_node **ir_get_dominance_frontier(const ir_node *block);
208 
211 #include "end.h"
212 
213 #endif
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_get_dominance_frontier(const ir_node *block)
Get the dominance frontier 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.
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_postdominated_first(const ir_node *bl)
Returns the first node in the list of nodes postdominated by a given blcok.
ir_node * get_Block_idom(const ir_node *block)
return immediate dominator of block
void irg_walk_func(ir_node *, void *)
type for graph-walk callbacks
Definition: firm_types.h:97
ir_node * get_Block_ipostdom(const ir_node *block)
return immediate postdominator of a block
struct ir_node ir_node
Procedure Graph Node.
Definition: firm_types.h:53
ir_node * ir_deepest_common_dominator(ir_node *block0, ir_node *block1)
Returns the deepest common dominator of two blocks.
int block_strictly_postdominates(const ir_node *a, const ir_node *b)
Check, if a block strictly post dominates another block, i.e.
int get_Block_dom_depth(const ir_node *bl)
void compute_postdoms(ir_graph *irg)
Computes the post dominance relation for all basic blocks of 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.
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.
int block_postdominates(const ir_node *a, const ir_node *b)
Check, if a block post dominates another block.
int block_dominates(const ir_node *a, const ir_node *b)
Check, if a block dominates another block.
struct ir_graph ir_graph
Procedure Graph.
Definition: firm_types.h:74
void ir_compute_dominance_frontiers(ir_graph *irg)
Compute the dominance frontiers for a given graph.
int get_Block_postdom_depth(const ir_node *bl)
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. ...
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.