<div dir="ltr"><div class="gmail_quote"><div>Seems reasonable</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div dir="ltr"><br></div><div dir="ltr">On Wed, Aug 15, 2018 at 4:58 PM Caio Marcelo de Oliveira Filho <<a href="mailto:caio.oliveira@intel.com">caio.oliveira@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Since there's no particular reason for the index to be 0, choose an<br>
index that is not used by other block. This is convenient when we<br>
store "per-block" data in an array AND look for the successors<br>
data (e.g. any kind of backwards data-flow analysis).<br>
---<br>
src/compiler/nir/nir.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c<br>
index e12aa5d80f5..1a5cfc27b74 100644<br>
--- a/src/compiler/nir/nir.c<br>
+++ b/src/compiler/nir/nir.c<br>
@@ -1641,7 +1641,7 @@ nir_index_blocks(nir_function_impl *impl)<br>
block->index = index++;<br>
}<br>
<br>
- impl->num_blocks = index;<br>
+ impl->num_blocks = impl->end_block->index = index;<br></blockquote><div><br></div><div>Mind dropping in a quick comment saying that end_block isn't really in the program which is why it's index is >= num_blocks.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
static bool<br>
-- <br>
2.18.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div>