<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 14, 2015 at 7:27 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>
<br>
Just curious, how did this come about?<br></blockquote><div><br></div><div>I was running shader-db and it was segfaulting.  I'm not sure why I didn't notice it before.  Perhaps it's because of the new optimizations you asked me to add?  In any case, it's fixed now.<br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
On Wed, Jan 14, 2015 at 10:15 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> Without the break, it was possible that an instruction would match multiple<br>
> expressions.  If this happened, you could end up trying to replace it<br>
> multiple times and get a segfault.  This makes it so that, after a<br>
> successful replacement, it moves on to the next instruction.<br>
> ---<br>
>  src/glsl/nir/nir_algebraic.py | 4 +++-<br>
>  1 file changed, 3 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/glsl/nir/nir_algebraic.py b/src/glsl/nir/nir_algebraic.py<br>
> index 72703be..f9b246d 100644<br>
> --- a/src/glsl/nir/nir_algebraic.py<br>
> +++ b/src/glsl/nir/nir_algebraic.py<br>
> @@ -192,8 +192,10 @@ ${pass_name}_block(nir_block *block, void *void_state)<br>
>           for (unsigned i = 0; i < ARRAY_SIZE(${pass_name}_${opcode}_xforms); i++) {<br>
>              if (nir_replace_instr(alu, ${pass_name}_${opcode}_xforms[i].search,<br>
>                                    ${pass_name}_${opcode}_xforms[i].replace,<br>
> -                                  state->mem_ctx))<br>
> +                                  state->mem_ctx)) {<br>
>                 state->progress = true;<br>
> +               break;<br>
> +            }<br>
>           }<br>
>           break;<br>
>        % endfor<br>
> --<br>
> 2.2.1<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>