<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 27, 2018 at 4:33 PM, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Mar 27, 2018 at 4:29 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> This was causing us to walk dest_components times over a thing with no<br>
> destination.  This happened to work because all of the image intrinsics<br>
> without a destination also happened to have dest_components == 0.  We<br>
> shouldn't be reading dest_components if has_dest == false.<br>
> ---<br>
>  src/intel/compiler/brw_fs_nir.<wbr>cpp | 8 +++++---<br>
>  1 file changed, 5 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/src/intel/compiler/brw_fs_<wbr>nir.cpp b/src/intel/compiler/brw_fs_<wbr>nir.cpp<br>
> index f5d5399..8d1c387 100644<br>
> --- a/src/intel/compiler/brw_fs_<wbr>nir.cpp<br>
> +++ b/src/intel/compiler/brw_fs_<wbr>nir.cpp<br>
> @@ -3848,9 +3848,11 @@ fs_visitor::nir_emit_<wbr>intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr<br>
>                                   get_image_atomic_op(instr-><wbr>intrinsic, type));<br>
><br>
>        /* Assign the result. */<br>
> -      for (unsigned c = 0; c < info->dest_components; ++c)<br>
> -         bld.MOV(offset(retype(dest, base_type), bld, c),<br>
> -                 offset(tmp, bld, c));<br>
> +      if (nir_intrinsic_infos[instr-><wbr>intrinsic].has_dest) {<br>
> +         for (unsigned c = 0; c < info->dest_components; ++c)<br>
> +            bld.MOV(offset(retype(dest, base_type), bld, c),<br>
> +                    offset(tmp, bld, c));<br>
<br>
</span>Nested control flow and a multiline statement: braces required. Please<br>
fix while you're here.<br></blockquote><div><br></div><div>Done.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Reviewed-by: Matt Turner <<a href="mailto:mattst88@gmail.com">mattst88@gmail.com</a>><br>
</blockquote></div><br></div><div class="gmail_extra">Thanks!<br><br></div><div class="gmail_extra">--Jason<br></div></div>