<div dir="ltr">With the patches I just sent, we'll drop this from the series and use the nir_dominance_lca function in GCM instead.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 5, 2015 at 3:42 PM, Connor Abbott <span dir="ltr"><<a href="mailto:cwabbott0@gmail.com" target="_blank">cwabbott0@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Reviewed-by: Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>><br>
<div><div class="h5"><br>
On Thu, Feb 5, 2015 at 5:29 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> ---<br>
>  src/glsl/nir/nir.h           | 3 +++<br>
>  src/glsl/nir/nir_dominance.c | 9 ++++++++-<br>
>  2 files changed, 11 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h<br>
> index 32c991a..8e5e686 100644<br>
> --- a/src/glsl/nir/nir.h<br>
> +++ b/src/glsl/nir/nir.h<br>
> @@ -1136,6 +1136,9 @@ typedef struct nir_block {<br>
>      */<br>
>     struct nir_block *imm_dom;<br>
><br>
> +   /* This block's depth in the dominator tree; zero for the start block */<br>
> +   unsigned dom_depth;<br>
> +<br>
>     /* This node's children in the dominance tree */<br>
>     unsigned num_dom_children;<br>
>     struct nir_block **dom_children;<br>
> diff --git a/src/glsl/nir/nir_dominance.c b/src/glsl/nir/nir_dominance.c<br>
> index 67fdcc6..898b139 100644<br>
> --- a/src/glsl/nir/nir_dominance.c<br>
> +++ b/src/glsl/nir/nir_dominance.c<br>
> @@ -131,6 +131,9 @@ calc_dom_frontier_cb(nir_block *block, void *state)<br>
>   * 3. For each node, add itself to its parent's list of children, using<br>
>   *    num_dom_children as an index - at the end of this step, num_dom_children<br>
>   *    for each node will be the same as it was at the end of step #1.<br>
> + *<br>
> + *    While we're at it, this is also a convenient time to set the<br>
> + *    dominator depth for each node.<br>
>   */<br>
><br>
>  static bool<br>
> @@ -161,8 +164,12 @@ block_add_child(nir_block *block, void *state)<br>
>  {<br>
>     (void) state;<br>
><br>
> -   if (block->imm_dom)<br>
> +   if (block->imm_dom) {<br>
>        block->imm_dom->dom_children[block->imm_dom->num_dom_children++] = block;<br>
> +      block->dom_depth = block->imm_dom->dom_depth + 1;<br>
> +   } else {<br>
> +      block->dom_depth = 0;<br>
> +   }<br>
><br>
>     return true;<br>
>  }<br>
> --<br>
> 2.2.2<br>
><br>
</div></div>> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div>