i965/cfg: Add function to generate a dot file of the dominator tree.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Matt Turner 2014-02-26 16:15:52 -08:00
parent b06eef05d0
commit 662c645318
2 changed files with 11 additions and 0 deletions

View 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");
}

View File

@ -275,6 +275,7 @@ struct cfg_t {
void dump(backend_visitor *v);
void dump_cfg();
void dump_domtree();
#endif
void *mem_ctx;