summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-01-07 14:11:55 -0600
committerMarge Bot <[email protected]>2020-01-13 17:23:46 +0000
commitf09db0bed5fa0227e10c8e911a118803f23a8fac (patch)
treeabcd1b9e6fd7302beb92218e400bd3f9b7ac80f6 /src/compiler
parentada49bae5e039b10913bc61ba7b037227e7e49aa (diff)
nir: Handle more barriers in dead_write and copy_prop
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_opt_copy_prop_vars.c13
-rw-r--r--src/compiler/nir/nir_opt_dead_write_vars.c9
2 files changed, 22 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c b/src/compiler/nir/nir_opt_copy_prop_vars.c
index c4544eac0f2..fdbf62c3599 100644
--- a/src/compiler/nir/nir_opt_copy_prop_vars.c
+++ b/src/compiler/nir/nir_opt_copy_prop_vars.c
@@ -807,6 +807,19 @@ copy_prop_vars_block(struct copy_prop_var_state *state,
nir_var_mem_shared);
break;
+ case nir_intrinsic_memory_barrier_buffer:
+ case nir_intrinsic_memory_barrier_atomic_counter:
+ if (debug) dump_instr(instr);
+
+ apply_barrier_for_modes(copies, nir_var_mem_ssbo);
+ break;
+
+ case nir_intrinsic_memory_barrier_shared:
+ if (debug) dump_instr(instr);
+
+ apply_barrier_for_modes(copies, nir_var_mem_shared);
+ break;
+
case nir_intrinsic_scoped_memory_barrier:
if (debug) dump_instr(instr);
diff --git a/src/compiler/nir/nir_opt_dead_write_vars.c b/src/compiler/nir/nir_opt_dead_write_vars.c
index 201e0847ce9..ffe0de771da 100644
--- a/src/compiler/nir/nir_opt_dead_write_vars.c
+++ b/src/compiler/nir/nir_opt_dead_write_vars.c
@@ -139,6 +139,15 @@ remove_dead_write_vars_local(void *mem_ctx, nir_block *block)
break;
}
+ case nir_intrinsic_memory_barrier_buffer:
+ case nir_intrinsic_memory_barrier_atomic_counter:
+ clear_unused_for_modes(&unused_writes, nir_var_mem_ssbo);
+ break;
+
+ case nir_intrinsic_memory_barrier_shared:
+ clear_unused_for_modes(&unused_writes, nir_var_mem_shared);
+ break;
+
case nir_intrinsic_scoped_memory_barrier: {
if (nir_intrinsic_memory_semantics(intrin) & NIR_MEMORY_RELEASE) {
clear_unused_for_modes(&unused_writes,