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>