diff options
-rw-r--r-- | src/panfrost/bifrost/bi_print.c | 30 | ||||
-rw-r--r-- | src/panfrost/bifrost/bi_print.h | 1 |
2 files changed, 31 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"); +} diff --git a/src/panfrost/bifrost/bi_print.h b/src/panfrost/bifrost/bi_print.h index fb7de0bc89d..a88844fc244 100644 --- a/src/panfrost/bifrost/bi_print.h +++ b/src/panfrost/bifrost/bi_print.h @@ -41,5 +41,6 @@ const char * bi_ldst_type_name(enum bifrost_ldst_type type); void bi_print_instruction(bi_instruction *ins, FILE *fp); void bi_print_bundle(bi_bundle *bundle, FILE *fp); void bi_print_clause(bi_clause *clause, FILE *fp); +void bi_print_block(bi_block *block, FILE *fp); #endif |