nir/dead_write_vars: Get modes directly from derefs
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 13 Dec 2018 22:30:24 +0000 (16:30 -0600)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 18 Dec 2018 19:13:28 +0000 (13:13 -0600)
commit5dad1abfdcfc772c63e7c883ab34ae1ad39461f3
tree58923ac7792aa571851d186c9029925b857c6114
parentfa40a58fd9c0faeead561fd1dbaaaefc6eb61633
nir/dead_write_vars: Get modes directly from derefs

Instead of going all the way back to the variable, just look at the
deref.  The modes are guaranteed to be the same by nir_validate whenever
the variable can be found.  This fixes clear_unused_for_modes for
derefs that don't have an accessible variable.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/nir/nir_opt_dead_write_vars.c