aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-05 08:22:07 -0500
committerMarge Bot <[email protected]>2020-03-05 14:35:38 +0000
commitc152d4c8352aca678386eaf75da83ae95e1bd7b5 (patch)
tree45d2ba871569b7ec8865580c234f5e7c41173bf2 /src
parentc316d1553bc27e9f64a14fcce147de96bea430e0 (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')
-rw-r--r--src/panfrost/bifrost/bi_print.c30
-rw-r--r--src/panfrost/bifrost/bi_print.h1
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