nir/opt_vectorize: hash whether a swizzle accesses elements beyond the maximum vector...
authorDaniel Schürmann <daniel@schuermann.dev>
Fri, 11 Sep 2020 10:05:17 +0000 (11:05 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 31 Dec 2020 16:44:58 +0000 (16:44 +0000)
commita3785e348142d180f9632ec27c0d0c0e981e6734
tree0af5875210093cda1e46448f4824778da082e782
parent46e74280310820a885e2c598c4ef983819bbeb15
nir/opt_vectorize: hash whether a swizzle accesses elements beyond the maximum vectorization factor

Swizzles that access components outside of the maximum
vector size cannot be vectorized with each other.
This patch creates different hash bins for this case.

For example accesses to .x and .y are considered different variables
compared to accesses to .z and .w for 16-bit vec2.

This prevents the vectorization of things like
   vec2 16 ssa_3 = iadd ssa_1.xz, ssa_2.xz

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6666>
src/compiler/nir/nir_opt_vectorize.c