aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linearize.h
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-09-19 12:38:15 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-07-01 00:18:44 +0200
commit787153d14e2435df199186db0480ec94d9d74de0 (patch)
treeb74bbc69b507ef4e8ba33094b7218e10e6751e1a /linearize.h
parent27e5889875392ab031d86745e2259c7ff135309e (diff)
downloadsparse-dev-787153d14e2435df199186db0480ec94d9d74de0.tar.gz
dom: calculate the dominance tree
Build the CFG's dominance tree and for each BB record: - the immediate dominator as bb->idom (is null for entry BB). - the list of immediately dominated BB as bb->doms. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'linearize.h')
-rw-r--r--linearize.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/linearize.h b/linearize.h
index c52c6ca5..5e776693 100644
--- a/linearize.h
+++ b/linearize.h
@@ -268,11 +268,14 @@ struct basic_block {
union {
int context;
int postorder_nr; /* postorder number */
+ int dom_level; /* level in the dominance tree */
};
struct entrypoint *ep;
struct basic_block_list *parents; /* sources */
struct basic_block_list *children; /* destinations */
struct instruction_list *insns; /* Linear list of instructions */
+ struct basic_block *idom; /* link to the immediate dominator */
+ struct basic_block_list *doms; /* list of BB idominated by this one */
struct pseudo_list *needs, *defines;
union {
unsigned int nr; /* unique id for label's names */
@@ -374,6 +377,7 @@ struct entrypoint {
struct basic_block_list *bbs;
struct basic_block *active;
struct instruction *entry;
+ unsigned int dom_levels; /* max levels in the dom tree */
};
extern void insert_select(struct basic_block *bb, struct instruction *br, struct instruction *phi, pseudo_t if_true, pseudo_t if_false);