gallivm: use shufflevector for shuffles when index is constant data
authorAutumn on Tape <autumn@cyfox.net>
Fri, 1 Apr 2022 20:03:30 +0000 (13:03 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 3 May 2022 23:09:37 +0000 (23:09 +0000)
commit57e25fc55c831a9249f315f0958c680a4daa6c28
tree6d0a6c6d4c588bd9391b9ffffdc57f39cef63157
parent433ec234572b59886c156ca426f8581e38927f03
gallivm: use shufflevector for shuffles when index is constant data

This checks if index is a ConstantAggregateZero, ConstantDataSequential,
or UndefValue and emits a single shufflevector instead of a loop if so.

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>
src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c