2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief Construct and access dominator tree -- private datastructures.
9 * @author Goetz Lindenmaier
12 #ifndef FIRM_ANA_IRDOM_T_H
13 #define FIRM_ANA_IRDOM_T_H
19 /** For dominator information */
20 typedef struct ir_dom_info {
21 ir_node *idom; /**< immediate CFG dominator */
22 ir_node *next; /**< The next node in the dominated list of @c idom. */
23 ir_node *first; /**< The first node in the list of nodes
24 this nodes dominates immediately. */
25 unsigned tree_pre_num; /**< The pre-order number from a dfs walk
26 over the dominator tree. */
27 unsigned max_subtree_pre_num; /**< The largest tree pre num found in the
28 dominator subtree of this node. */
29 int pre_num; /**< pre-order graph-walk number */
30 int dom_depth; /**< depth in dominator-tree */
33 typedef struct ir_dom_front_info_t {
34 pmap *df_map; /**< A map, mapping every block to a list of its dominance frontier blocks. */
35 struct obstack obst; /**< An obstack holding all the frontier data. */
36 } ir_dom_front_info_t;
38 void set_Block_idom(ir_node *bl, ir_node *n);
40 int get_Block_dom_depth(const ir_node *bl);
41 void set_Block_dom_depth(ir_node *bl, int depth);
43 int get_Block_dom_pre_num(const ir_node *bl);
44 void set_Block_dom_pre_num(ir_node *bl, int num);
46 void set_Block_ipostdom(ir_node *bl, ir_node *n);
48 int get_Block_postdom_depth(const ir_node *bl);
49 void set_Block_postdom_depth(ir_node *bl, int depth);
51 int get_Block_postdom_pre_num(const ir_node *bl);
52 void set_Block_postdom_pre_num(ir_node *bl, int num);
54 unsigned get_Block_dom_tree_pre_num(const ir_node *bl);
55 unsigned get_Block_pdom_tree_pre_num(const ir_node *bl);
57 unsigned get_Block_dom_max_subtree_pre_num(const ir_node *bl);
58 unsigned get_Block_pdom_max_subtree_pre_num(const ir_node *bl);
60 void ir_free_dominance_frontiers(ir_graph *irg);