From: Matt Turner Date: Thu, 27 Feb 2014 00:15:52 +0000 (-0800) Subject: i965/cfg: Add function to generate a dot file of the dominator tree. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=662c645318849164526d1a79f86db9dcb6711ad9;p=mesa.git i965/cfg: Add function to generate a dot file of the dominator tree. Reviewed-by: Kenneth Graunke --- 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;