From 662c645318849164526d1a79f86db9dcb6711ad9 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 26 Feb 2014 16:15:52 -0800 Subject: [PATCH] i965/cfg: Add function to generate a dot file of the dominator tree. Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_cfg.cpp | 10 ++++++++++ src/mesa/drivers/dri/i965/brw_cfg.h | 1 + 2 files changed, 11 insertions(+) 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; -- 2.30.2