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>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2019-02-25 20:37:59 -08:00
parent 6c0de78cc2
commit 1458aa1f78
2 changed files with 25 additions and 24 deletions
+2 -2
View File
@@ -603,7 +603,7 @@ TEST_F(nir_copy_prop_vars_test, store_load_direct_array_deref_on_vector)
EXPECT_TRUE(nir_src_as_alu_instr(&fourth_store->src[1]));
}
TEST_F(nir_copy_prop_vars_test, DISABLED_store_load_indirect_array_deref_on_vector)
TEST_F(nir_copy_prop_vars_test, store_load_indirect_array_deref_on_vector)
{
nir_variable *vec = create_ivec2(nir_var_mem_ssbo, "vec");
nir_variable *idx = create_int(nir_var_mem_ssbo, "idx");
@@ -640,7 +640,7 @@ TEST_F(nir_copy_prop_vars_test, DISABLED_store_load_indirect_array_deref_on_vect
EXPECT_EQ(first->src[1].ssa, second->src[1].ssa);
}
TEST_F(nir_copy_prop_vars_test, DISABLED_store_load_direct_and_indirect_array_deref_on_vector)
TEST_F(nir_copy_prop_vars_test, store_load_direct_and_indirect_array_deref_on_vector)
{
nir_variable *vec = create_ivec2(nir_var_mem_ssbo, "vec");
nir_variable *idx = create_int(nir_var_mem_ssbo, "idx");