nir: Add some sanity assertions in opt_large_constants
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 8 Apr 2020 20:11:57 +0000 (15:11 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Apr 2020 17:00:13 +0000 (17:00 +0000)
commit9b17d7caac76e1c2dd4579c198b2e32b762bb656
treecdde126cc46351307db5f1c76df6c2c3441b1341
parent33eb43349e8c3e8216f51ec838d9b9ab23361873
nir: Add some sanity assertions in opt_large_constants

We make some assumptions in opt_large_constants such as the size_align
function returning the obvious sizes for vectors.  Now that we've got
the deref_size lying around, we may as well assert it's consistent with
our assumptions.  In particular, we now assert that it really claims
booleans are 32-bit.  If anyone's driver ever decides to be clever and
change this, we'll now catch the breakage earlier.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4468>
src/compiler/nir/nir_opt_large_constants.c