i965/cfg: Add function to generate a dot file of the dominator tree.
authorMatt Turner <mattst88@gmail.com>
Thu, 27 Feb 2014 00:15:52 +0000 (16:15 -0800)
committerMatt Turner <mattst88@gmail.com>
Wed, 18 Feb 2015 04:44:09 +0000 (20:44 -0800)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_cfg.cpp
src/mesa/drivers/dri/i965/brw_cfg.h

index e094a88..7e7770e 100644 (file)
@@ -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");
+}
index 4d4eb2d..56d7d07 100644 (file)
@@ -275,6 +275,7 @@ struct cfg_t {
 
    void dump(backend_visitor *v);
    void dump_cfg();
+   void dump_domtree();
 #endif
    void *mem_ctx;