nir: Assert that we don't shrink bit-sizes in nir_lower_bit_size()
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 19 May 2023 00:15:04 +0000 (17:15 -0700)
committerMarge Bot <emma+marge@anholt.net>
Fri, 19 May 2023 22:44:37 +0000 (22:44 +0000)
commit462ef200d81d12d6ff0876b5cfc2a17783f930d1
tree7d61bd5cd1783287cef610b56ccb37574b621f4c
parenta2d384a5c0947952887115624a156afd649e20b0
nir: Assert that we don't shrink bit-sizes in nir_lower_bit_size()

The idea of this pass is to promote small bit-sizes to larger, supported
bit-sizes for certain operations.  It doesn't handle emulating large
bit-size operations on smaller bit-sizes; passes like nir_lower_int64
and nir_lower_doubles handle that.

So, assert that we aren't shrinking the bit-size, as this will almost
certainly produce incorrect results.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23123>
src/compiler/nir/nir_lower_bit_size.c