mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
nir: Give end_block its own index
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). v2: Add a note about end_block's index. (Jason) Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
8364ec3fce
commit
410de0e3f1
1 changed files with 4 additions and 1 deletions
|
|
@ -1641,7 +1641,10 @@ nir_index_blocks(nir_function_impl *impl)
|
|||
block->index = index++;
|
||||
}
|
||||
|
||||
impl->num_blocks = index;
|
||||
/* The end_block isn't really part of the program, which is why its index
|
||||
* is >= num_blocks.
|
||||
*/
|
||||
impl->num_blocks = impl->end_block->index = index;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue