pan/bi: Defer block naming until after emit

This ensures names are meaningful.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>
This commit is contained in:
Alyssa Rosenzweig 2020-05-28 14:44:33 -04:00 committed by Marge Bot
parent bd6ff4f7e1
commit c697992ca1
2 changed files with 7 additions and 3 deletions

View file

@ -995,8 +995,6 @@ create_empty_block(bi_context *ctx)
_mesa_hash_pointer,
_mesa_key_pointer_equal);
blk->base.name = ctx->block_name_count++;
return blk;
}
@ -1289,8 +1287,15 @@ bifrost_compile_shader_nir(nir_shader *nir, panfrost_program *program, unsigned
break; /* TODO: Multi-function shaders */
}
unsigned block_source_count = 0;
bi_foreach_block(ctx, _block) {
bi_block *block = (bi_block *) _block;
/* Name blocks now that we're done emitting so the order is
* consistent */
block->base.name = block_source_count++;
bi_lower_combine(ctx, block);
}

View file

@ -409,7 +409,6 @@ typedef struct {
/* During NIR->BIR */
nir_function_impl *impl;
bi_block *current_block;
unsigned block_name_count;
bi_block *after_block;
bi_block *break_block;
bi_block *continue_block;