nir/lower_vec_to_movs: Coalesce into destinations of fdot instructions
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 10 Sep 2015 00:18:55 +0000 (17:18 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 15 Sep 2015 19:38:48 +0000 (12:38 -0700)
commit29348631fe7bf732a38856ea842cfc7aa2263468
tree6a682b7036ca7c1ff9bf5447f283b9335f9b8a5b
parenta88ce0c1c4c1f77209b71d5a6858f952642f385a
nir/lower_vec_to_movs: Coalesce into destinations of fdot instructions

Now that we have a replicating fdot instruction, we can actually coalesce
into the destinations of vec4 instructions.  We couldn't really do this
before because, if the destination had to end up in .z, we couldn't
reswizzle the instruction.  With a replicated destination, the result ends
up in all channels so we can just set the writemask and we're done.

Shader-db results for vec4 programs on Haswell:

   total instructions in shared programs: 1747753 -> 1746280 (-0.08%)
   instructions in affected programs:     143274 -> 141801 (-1.03%)
   helped:                                667
   HURT:                                  0

It turns out that dot-products matter...

Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
src/glsl/nir/nir_lower_vec_to_movs.c