diff options
author | Rhys Perry <[email protected]> | 2019-12-03 10:48:18 +0000 |
---|---|---|
committer | Rhys Perry <[email protected]> | 2019-12-04 12:21:40 +0000 |
commit | 3e67aa2e4e0c116b8b3f1e3717b086fdb576934e (patch) | |
tree | de95678b4cb12bf8888f76039ca281fd27b675ae /src/compiler/nir/tests | |
parent | 637c5a1dd9bd56da04d48b8c92c1c40b12ae76ab (diff) |
nir/load_store_vectorize: fix combining stores with aliasing loads between
v2: add test
Fixes: ce9205c03bd ('nir: add a load/store vectorization pass')
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]> (v1)
Reviewed-by: Connor Abbott <[email protected]> (v2)
Diffstat (limited to 'src/compiler/nir/tests')
-rw-r--r-- | src/compiler/nir/tests/load_store_vectorizer_tests.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compiler/nir/tests/load_store_vectorizer_tests.cpp b/src/compiler/nir/tests/load_store_vectorizer_tests.cpp index 2251b43fb61..0b332d8bc78 100644 --- a/src/compiler/nir/tests/load_store_vectorizer_tests.cpp +++ b/src/compiler/nir/tests/load_store_vectorizer_tests.cpp @@ -620,6 +620,20 @@ TEST_F(nir_load_store_vectorize_test, ssbo_load_identical_store_identical) ASSERT_EQ(count_intrinsics(nir_intrinsic_load_ssbo), 2); } +TEST_F(nir_load_store_vectorize_test, ssbo_store_identical_load_identical) +{ + create_store(nir_var_mem_ssbo, 0, 0, 0x1); + create_load(nir_var_mem_ssbo, 0, 0, 0x2); + create_store(nir_var_mem_ssbo, 0, 0, 0x3); + + nir_validate_shader(b->shader, NULL); + ASSERT_EQ(count_intrinsics(nir_intrinsic_store_ssbo), 2); + + EXPECT_FALSE(run_vectorizer(nir_var_mem_ssbo)); + + ASSERT_EQ(count_intrinsics(nir_intrinsic_store_ssbo), 2); +} + /* if nir_opt_load_store_vectorize were implemented like many load/store * optimization passes are (for example, nir_opt_combine_stores and * nir_opt_copy_prop_vars) and stopped tracking a load when an aliasing store is |