<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Fri, Feb 6, 2015 at 5:34 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">I'd rather keep it the way it was, since that's how it's presented as<br>
pseudocode in the paper and someone reading this is more likely to be<br>
confused by a function with the exact same name as in the paper but a<br>
different implementation.<br>
</blockquote><div> <br></div><div>Sure. I don't care that much. It's a simple enough function that I doubt that'll be a problem but it doesn't matter much. I'll drop the hunk.<br></div><div>--Jason<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
On Fri, Feb 6, 2015 at 5:12 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> Before the function involved three loops and three different branching<br>
> conditions. Now it involves one loop and one if statement. This is a<br>
> little simpler.<br>
> ---<br>
> src/glsl/nir/nir.h | 2 ++<br>
> src/glsl/nir/nir_dominance.c | 16 ++++++++++++++--<br>
> 2 files changed, 16 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h<br>
> index 4cb2e92..886dcd2 100644<br>
> --- a/src/glsl/nir/nir.h<br>
> +++ b/src/glsl/nir/nir.h<br>
> @@ -1500,6 +1500,8 @@ static inline void nir_validate_shader(nir_shader *shader) { }<br>
> void nir_calc_dominance_impl(nir_function_impl *impl);<br>
> void nir_calc_dominance(nir_shader *shader);<br>
><br>
> +nir_block *nir_dominance_lca(nir_block *b1, nir_block *b2);<br>
> +<br>
> void nir_dump_dom_tree_impl(nir_function_impl *impl, FILE *fp);<br>
> void nir_dump_dom_tree(nir_shader *shader, FILE *fp);<br>
><br>
> diff --git a/src/glsl/nir/nir_dominance.c b/src/glsl/nir/nir_dominance.c<br>
> index 67fdcc6..1022692 100644<br>
> --- a/src/glsl/nir/nir_dominance.c<br>
> +++ b/src/glsl/nir/nir_dominance.c<br>
> @@ -65,9 +65,9 @@ intersect(nir_block *b1, nir_block *b2)<br>
> * because we index blocks from beginning -> end (i.e. reverse<br>
> * post-order) instead of post-order like they assume.<br>
> */<br>
> - while (b1->index > b2->index)<br>
> + if (b1->index > b2->index)<br>
> b1 = b1->imm_dom;<br>
> - while (b2->index > b1->index)<br>
> + else<br>
> b2 = b2->imm_dom;<br>
> }<br>
><br>
> @@ -212,6 +212,18 @@ nir_calc_dominance(nir_shader *shader)<br>
> }<br>
> }<br>
><br>
> +nir_block *<br>
> +nir_dominance_lca(nir_block *b1, nir_block *b2)<br>
> +{<br>
> + assert(nir_cf_node_get_function(&b1->cf_node) ==<br>
> + nir_cf_node_get_function(&b2->cf_node));<br>
> +<br>
> + assert(nir_cf_node_get_function(&b1->cf_node)->valid_metadata &<br>
> + nir_metadata_dominance);<br>
> +<br>
> + return intersect(b1, b2);<br>
> +}<br>
> +<br>
> static bool<br>
> dump_block_dom(nir_block *block, void *state)<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></div>