diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-05-28 14:44:33 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-29 20:34:55 +0000 |
commit | c697992ca18e6f059d167fa0a1a9af53b3f93fea (patch) | |
tree | 91ec36d4466e94afb3afc09f727c2d98aa4a826a /src/panfrost/bifrost | |
parent | bd6ff4f7e1845d380c366d4f643725fe76a101f5 (diff) |
pan/bi: Defer block naming until after emit
This ensures names are meaningful.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r-- | src/panfrost/bifrost/bifrost_compile.c | 9 | ||||
-rw-r--r-- | src/panfrost/bifrost/compiler.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index c06fd591638..cb6595a9de8 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -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); } diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index ad02a46a2d0..92dfb963ed7 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -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; |