nir: Introduce a nir_vec_scalars() helper using nir_ssa_scalar.
authorEmma Anholt <emma@anholt.net>
Thu, 3 Feb 2022 19:11:00 +0000 (11:11 -0800)
committerMarge Bot <emma+marge@anholt.net>
Wed, 2 Mar 2022 22:28:58 +0000 (22:28 +0000)
commitd95f9d189a46ecd6fecb54cd7c733fff89f3d85a
tree7739dc88314d32148e58b11c75181d9970aaf61e
parent48b3ef625e1909c1be31fbe10adb53734af38eb4
nir: Introduce a nir_vec_scalars() helper using nir_ssa_scalar.

Many users of nir_vec() do so by nir_channel()-ing a new ssa defs as movs
from other vectors to put the new vector together, which then just have to
get copy-propagated into the ALU srcs and DCEed away the temporary movs.
If they instead take nir_ssa_scalar, we can avoid that extra work.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14865>
src/compiler/nir/nir_builder.c
src/compiler/nir/nir_builder.h