compiler/nir: Add support for variable initialization from a pointer

Cherry-pick'd from 7acc81056f7ac6a869ef6403573b2572c77dbecf

Add a pointer_initializer field to nir_variable analogous to
constant_initializer, which can be used to initialize the nir_variable
to a pointer to another nir_variable. Just like the
constant_initializer, the pointer_initializer gets eliminated in the
nir_lower_constant_initializers pass.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3047>
Change-Id: Id8a25889835b81df870daeaa1825523fd9977a56
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/mesa/+/403110
Reviewed-by: John Bauman <jbauman@google.com>
8 files changed