nir/deref: Support casts and ptr_as_array in comparisons
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 13 Dec 2018 19:50:51 +0000 (13:50 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 8 Jan 2019 00:38:30 +0000 (00:38 +0000)
commitd8e3edb784d3afb313420fc8d58b491a57fad9c1
tree1152ea4d0b27b346e53e4257cad1ad156ef1cb64
parenta1c688517dee32c57af17d8e11029eb7470f52d4
nir/deref: Support casts and ptr_as_array in comparisons

The code which constructs deref paths already gives you the path
starting at the nearest deref_cast or deref_var.  All we need to do for
casts is handle the case where the start of the path isn't a deref_var.
For ptr_as_array derefs, we just bail if we have any after the
divergence point between the two derefs.  We may be able to do better in
the future but this works for now.

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