intel/nir: Call alu_to_scalar one last time before out-of-ssa
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 6 May 2019 17:25:29 +0000 (12:25 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 24 May 2019 13:38:11 +0000 (08:38 -0500)
A few of our very late passes can end up generating vectors accidentally
so we need to get rid of them.  The only known case of this is the ffma
peephole which generates fneg and fabs as vectors.  Currently, they're
not a problem because they get turned into fmov which the back-end
compiler knows how to handle as a vector.  That's about to change.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/intel/compiler/brw_nir.c

index 9a4afb4b77861533c66b1bc87d807e55ae55641b..50d6e48f50d5abe94abcadfdd5cf38be3adb075d 100644 (file)
@@ -931,6 +931,8 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler,
 
    OPT(brw_nir_lower_conversions);
 
+   if (is_scalar)
+      OPT(nir_lower_alu_to_scalar, NULL);
    OPT(nir_lower_to_source_mods, nir_lower_all_source_mods);
    OPT(nir_copy_prop);
    OPT(nir_opt_dce);