nir: intel/vec4: Add flag to disable some algebraic optimizations
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 3 Jun 2019 22:22:15 +0000 (15:22 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 11 Jul 2019 17:20:03 +0000 (10:20 -0700)
commit1259f6d80215152e647b5c32db4fad32e420d495
tree353a8c5eae4be4e57c748073e9a327ba9e579b9d
parent3a1fdca5ad206f578b0d54a490a8bf6f199c8851
nir: intel/vec4: Add flag to disable some algebraic optimizations

A couple patches later in this series use the flag to avoid a few
thousand shader-db regresions on all vec4 platforms.

I'm not particularly enamored with the name of this flag.  However, I
suspect the Intel vec4 backend is the only backend that will benefit
from it.  Specifically, the cases where this helps are all cases where
we want to prevent nir_opt_algebraic from rearranging instructions to
create 3-source instructions, such as ffma and flrp, with additional
immediate value or uniform sources.

The earlier commit "intel/vec4: Try to emit a single load for multiple
3-src instruction operands" solves most of the problems caused by
additional immediate values, but the restrictions on register strides
that cause problems for uniforms and shader inputs persist.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/compiler/nir/nir.h
src/intel/compiler/brw_compiler.c