Since there's no particular reason for the index to be 0, choose an index that is not used by other block. This is convenient when we store "per-block" data in an array AND look for the successors data (e.g. any kind of backwards data-flow analysis). --- src/compiler/nir/nir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index e12aa5d80f5..1a5cfc27b74 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -1641,7 +1641,7 @@ nir_index_blocks(nir_function_impl *impl) block->index = index++; } - impl->num_blocks = index; + impl->num_blocks = impl->end_block->index = index; } static bool -- 2.18.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev