diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-03-05 08:22:07 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-05 14:35:38 +0000 |
commit | c152d4c8352aca678386eaf75da83ae95e1bd7b5 (patch) | |
tree | 45d2ba871569b7ec8865580c234f5e7c41173bf2 /src/panfrost/bifrost/bi_print.c | |
parent | c316d1553bc27e9f64a14fcce147de96bea430e0 (diff) |
pan/bi: Add bi_print_block
Almost there...
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4061>
Diffstat (limited to 'src/panfrost/bifrost/bi_print.c')
-rw-r--r-- | src/panfrost/bifrost/bi_print.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index c2113eb48a5..5c465db6ed1 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -385,3 +385,33 @@ bi_print_clause(bi_clause *clause, FILE *fp) fprintf(fp, "\n"); } } + +void +bi_print_block(bi_block *block, FILE *fp) +{ + fprintf(fp, "block%u {\n", block->name); + + if (block->scheduled) { + bi_foreach_clause_in_block(block, clause) + bi_print_clause(clause, fp); + } else { + bi_foreach_instr_in_block(block, ins) + bi_print_instruction(ins, fp); + } + + if (block->successors[0]) { + fprintf(fp, " -> "); + + for (unsigned i = 0; i < ARRAY_SIZE(block->successors); ++i) { + if (block->successors[i]) + fprintf(fp, "block%u", block->successors[i]->name); + } + } + + fprintf(fp, " from "); + + bi_foreach_predecessor(block, pred) + fprintf(fp, "block%u ", pred->name); + + fprintf(fp, "\n"); +} |