<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Oct 15, 2018 at 1:48 PM Ian Romanick <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/14/2018 03:11 PM, Matt Turner wrote:<br>
> Unfortunately some int64 lowerings generate more int64 operations, so we<br>
> need to call this function a few times. Also call<br>
> nir_lower_alu_to_scalar() beforehand to make more int64 operations<br>
> available for lowering.<br>
> ---<br>
>  src/intel/compiler/brw_nir.c | 10 +++++++---<br>
>  1 file changed, 7 insertions(+), 3 deletions(-)<br>
> <br>
> diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c<br>
> index f61baee230a..066724c58a6 100644<br>
> --- a/src/intel/compiler/brw_nir.c<br>
> +++ b/src/intel/compiler/brw_nir.c<br>
> @@ -670,12 +670,16 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)<br>
>  Â  Â  */<br>
>  Â  Â OPT(nir_opt_algebraic);<br>
>  <br>
> +  Â if (is_scalar) {<br>
> +  Â  Â  OPT(nir_lower_alu_to_scalar);<br>
> +  Â }<br>
> +<br>
>  Â  Â /* Lower int64 instructions before nir_optimize so that loop unrolling<br>
>  Â  Â  * sees their actual cost.<br>
>  Â  Â  */<br>
> -  Â nir_lower_int64(nir, nir_lower_imul64 |<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  nir_lower_isign64 |<br>
> -  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  nir_lower_divmod64);<br>
> +  Â while (nir_lower_int64(nir, nir_lower_imul64 |<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â nir_lower_isign64 |<br>
> +  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â nir_lower_divmod64));<br>
<br>
I don't know that we have a specific coding standard about this, but I<br>
always like<br>
<br>
  Â  Â  Â  while (foo)<br>
  Â  Â  Â  Â  Â  Â  Â  /* empty */ ;<br>
<br>
just to make it obvious.<br></blockquote><div><br></div><div>I think I'd opt for "continue" but yeah, I think one or the other is better than silently putting the semicolon at the end.<br></div></div></div>