summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-08-15 10:43:56 -0700
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-08-19 08:32:17 -0700
commite3a418fe866aea61b149db728f85c30f218adcd2 (patch)
tree8ca83f9c5e4014d43fea679f5d7e37ee30ffde2f
parent2f92479ffcfc9119729b55d1f49217c90993bf06 (diff)
downloadmesa-e3a418fe866aea61b149db728f85c30f218adcd2.tar.gz
pan/midgard: Index blocks for printing
Better than having pointers flying about. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
-rw-r--r--src/panfrost/midgard/compiler.h6
-rw-r--r--src/panfrost/midgard/midgard_compile.c2
-rw-r--r--src/panfrost/midgard/midgard_print.c4
3 files changed, 10 insertions, 2 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index 217ab317090..1fddd3f1fe8 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -160,6 +160,9 @@ typedef struct midgard_block {
/* List of midgard_instructions emitted for the current block */
struct list_head instructions;
+ /* Index of the block in source order */
+ unsigned source_id;
+
bool is_scheduled;
/* List of midgard_bundles emitted (after the scheduler has run) */
@@ -229,6 +232,9 @@ typedef struct compiler_context {
int block_count;
struct list_head blocks;
+ /* TODO merge with block_count? */
+ unsigned block_source_count;
+
/* List of midgard_instructions emitted for the current block */
midgard_block *current_block;
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 12af84d17d6..67c5c848214 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -2264,6 +2264,8 @@ create_empty_block(compiler_context *ctx)
_mesa_hash_pointer,
_mesa_key_pointer_equal);
+ blk->source_id = ctx->block_source_count++;
+
return blk;
}
diff --git a/src/panfrost/midgard/midgard_print.c b/src/panfrost/midgard/midgard_print.c
index 5d19f6f6800..240780a1f7d 100644
--- a/src/panfrost/midgard/midgard_print.c
+++ b/src/panfrost/midgard/midgard_print.c
@@ -162,7 +162,7 @@ mir_print_instruction(midgard_instruction *ins)
void
mir_print_block(midgard_block *block)
{
- printf("%p: {\n", block);
+ printf("block%d: {\n", block->source_id);
mir_foreach_instr_in_block(block, ins) {
mir_print_instruction(ins);
@@ -173,7 +173,7 @@ mir_print_block(midgard_block *block)
if (block->nr_successors) {
printf(" -> ");
for (unsigned i = 0; i < block->nr_successors; ++i) {
- printf("%p%s", block->successors[i],
+ printf("block%d%s", block->successors[i]->source_id,
(i + 1) != block->nr_successors ? ", " : "");
}
}