nir/remove_dead_variables: Properly handle deref casts
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 28 Nov 2018 23:27:57 +0000 (17:27 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 8 Jan 2019 00:38:30 +0000 (00:38 +0000)
commit7e85480a67eea965481266bf4bcdb690b44e19bd
treebdc4b826f7b4807e2f43fb691dbfbc4002f5ab3d
parent78d80f7db2fab78b1af96d5acf216d71448d7972
nir/remove_dead_variables: Properly handle deref casts

We already detect any incomplete deref chains (where the deref is used
for something other than another deref or a load/store) and flag the
variable as used thanks to deref_used_for_not_store.  All that's left to
do is to properly skip casts when cleaning up.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/compiler/nir/nir_remove_dead_variables.c