nir/copy_prop_vars: handle indirect vector elements
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 26 Feb 2019 04:37:59 +0000 (20:37 -0800)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fri, 1 Mar 2019 07:55:31 +0000 (23:55 -0800)
commit1458aa1f78edc22ded5b40f17c148a22fcabfda2
tree2341bc981ecc6d16bcd931ac8c779b648bcbfbf7
parent6c0de78cc257240b5e55e033b4df8d7d87dcdfa7
nir/copy_prop_vars: handle indirect vector elements

Differently than the direct case, the indirect array derefs of vector
are handled like regular derefs, with the exception that we ignore any
vector entry that has SSA values when performing a load.  Such SSA
values don't help loading of the indirect unless we emit an if-ladder.

Copy_derefs are supported for indirects.

Also enable two tests that now pass.

v2: Remove unnecessary temporaries.  Be clearer when identifying the
    case where copy_entry doesn't help when we are dealing with an
    indirect array_deref (of a vector).  (Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_opt_copy_prop_vars.c
src/compiler/nir/tests/vars_tests.cpp