summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-02-26 16:15:52 -0800
committerMatt Turner <[email protected]>2015-02-17 20:44:09 -0800
commit662c645318849164526d1a79f86db9dcb6711ad9 (patch)
treefbae05fa4d92366b167443e07fb6f11c56d7752f
parentb06eef05d040ffcfe5a203387b1c4b5b0b32848a (diff)
i965/cfg: Add function to generate a dot file of the dominator tree.
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_cfg.cpp10
-rw-r--r--src/mesa/drivers/dri/i965/brw_cfg.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.cpp b/src/mesa/drivers/dri/i965/brw_cfg.cpp
index e094a88f0b5..7e7770e43cd 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.cpp
+++ b/src/mesa/drivers/dri/i965/brw_cfg.cpp
@@ -509,3 +509,13 @@ cfg_t::dump_cfg()
}
printf("}\n");
}
+
+void
+cfg_t::dump_domtree()
+{
+ printf("digraph DominanceTree {\n");
+ foreach_block(block, this) {
+ printf("\t%d -> %d\n", block->idom->num, block->num);
+ }
+ printf("}\n");
+}
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h
index 4d4eb2dad66..56d7d07abdf 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.h
+++ b/src/mesa/drivers/dri/i965/brw_cfg.h
@@ -275,6 +275,7 @@ struct cfg_t {
void dump(backend_visitor *v);
void dump_cfg();
+ void dump_domtree();
#endif
void *mem_ctx;