pan/midgard: Index blocks for printing
Better than having pointers flying about. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
parent
2f92479ffc
commit
e3a418fe86
|
@ -160,6 +160,9 @@ typedef struct midgard_block {
|
||||||
/* List of midgard_instructions emitted for the current block */
|
/* List of midgard_instructions emitted for the current block */
|
||||||
struct list_head instructions;
|
struct list_head instructions;
|
||||||
|
|
||||||
|
/* Index of the block in source order */
|
||||||
|
unsigned source_id;
|
||||||
|
|
||||||
bool is_scheduled;
|
bool is_scheduled;
|
||||||
|
|
||||||
/* List of midgard_bundles emitted (after the scheduler has run) */
|
/* List of midgard_bundles emitted (after the scheduler has run) */
|
||||||
|
@ -229,6 +232,9 @@ typedef struct compiler_context {
|
||||||
int block_count;
|
int block_count;
|
||||||
struct list_head blocks;
|
struct list_head blocks;
|
||||||
|
|
||||||
|
/* TODO merge with block_count? */
|
||||||
|
unsigned block_source_count;
|
||||||
|
|
||||||
/* List of midgard_instructions emitted for the current block */
|
/* List of midgard_instructions emitted for the current block */
|
||||||
midgard_block *current_block;
|
midgard_block *current_block;
|
||||||
|
|
||||||
|
|
|
@ -2264,6 +2264,8 @@ create_empty_block(compiler_context *ctx)
|
||||||
_mesa_hash_pointer,
|
_mesa_hash_pointer,
|
||||||
_mesa_key_pointer_equal);
|
_mesa_key_pointer_equal);
|
||||||
|
|
||||||
|
blk->source_id = ctx->block_source_count++;
|
||||||
|
|
||||||
return blk;
|
return blk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ mir_print_instruction(midgard_instruction *ins)
|
||||||
void
|
void
|
||||||
mir_print_block(midgard_block *block)
|
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_foreach_instr_in_block(block, ins) {
|
||||||
mir_print_instruction(ins);
|
mir_print_instruction(ins);
|
||||||
|
@ -173,7 +173,7 @@ mir_print_block(midgard_block *block)
|
||||||
if (block->nr_successors) {
|
if (block->nr_successors) {
|
||||||
printf(" -> ");
|
printf(" -> ");
|
||||||
for (unsigned i = 0; i < block->nr_successors; ++i) {
|
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 ? ", " : "");
|
(i + 1) != block->nr_successors ? ", " : "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue