nir/large_constants: Handle incomplete derefs
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 16 Jul 2020 01:12:33 +0000 (20:12 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 19 Aug 2020 19:43:31 +0000 (19:43 +0000)
commitdf9596353a60bd38bc0185501750a7f4da5a06c5
treec070da5cb51f0b96e930c5ddb4860c178b0e409b
parent9f3c595dfc4cd1745e10698f0c037a7f32b63789
nir/large_constants: Handle incomplete derefs

This pass works entirely with variables, all we have to do is ignore any
derefs we see which we can't chase back to the variable.  The one
interesting case we have to handle is if we have a complex use of a
deref_var.  In that case, we have to flag it non-constant.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6210>
src/compiler/nir/nir_opt_large_constants.c