nir/opt_vectorize: Add a callback for filtering of vectorizing.
authorEric Anholt <eric@anholt.net>
Thu, 27 Aug 2020 19:49:13 +0000 (12:49 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 2 Sep 2020 16:59:17 +0000 (09:59 -0700)
commitf25e169897e73d30e31f6d19af1cc0ed487eb512
treea49ae1b8a840aa0a2480b9af9664145fcb1d4c78
parent479d9c97eb2c85b7df81f39281867c5559aa0bba
nir/opt_vectorize: Add a callback for filtering of vectorizing.

For NIR-to-TGSI, we don't want to revectorize 64-bit ops that we split to
scalar beyond vec2 width.  We even have some ops that we would rather
retain as scalar due to TGSI opcodes being scalar, or having more unusual
requirements.

This could be used to do the vectorize_vec2_16bit filtering, but that
shader compiler option is also used in algebraic so leave it in place for
now.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6567>
src/compiler/nir/nir.h
src/compiler/nir/nir_opt_vectorize.c
src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c
src/gallium/drivers/lima/lima_program.c
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/sfn/sfn_nir.cpp
src/panfrost/midgard/midgard_compile.c