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 e094a88f0b5af973d43e54a45ace0363fd0e3fb7..7e7770e43cdba1902febb4bb61ce17c785116df9 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 4d4eb2dad66eaca88ca3f1426d5d701e4bcf8a19..56d7d07abdfbccc80a2dea57329c387c8cdda197 100644 (file)
@@ -275,6 +275,7 @@ struct cfg_t {
 
    void dump(backend_visitor *v);
    void dump_cfg();
+   void dump_domtree();
 #endif
    void *mem_ctx;