nir: Optimize unpacking 16 bit values that were originally packed
authorJesse Natalie <jenatali@microsoft.com>
Tue, 23 May 2023 22:49:38 +0000 (15:49 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 13 Jun 2023 00:43:36 +0000 (00:43 +0000)
commitfba82797d720c930051d1593062840713e874250
treece1d29562591cf4b18b7d57caf1ef382373745f2
parent663d957480b7752ffb5f90657ac424d1260cf5e9
nir: Optimize unpacking 16 bit values that were originally packed

I was seeing u2u64 still in my final shader after pack/unpack were
lowered, which sounds to me like some other optimizations are missing
for detecting the post-lowering pack/unpack patterns, but let's at
least add some patterns for the simple cases.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23173>
src/compiler/nir/nir_opt_algebraic.py