diff options
author | Jason Ekstrand <[email protected]> | 2020-01-07 14:54:26 -0600 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-13 17:23:47 +0000 |
commit | e40b11bbcb02dde1a8f989ca6545e22414c6f4ce (patch) | |
tree | 7b43b62263e3c856b4bc778de395002c3462a0d0 /src/compiler | |
parent | bd3ab75aef95d062cedaa92504fede9887a2c370 (diff) |
nir: Rename nir_intrinsic_barrier to control_barrier
This is a more explicit name now that we don't want it to be doing any
memory barrier stuff for us.
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/glsl/glsl_to_nir.cpp | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_intrinsics.py | 7 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_combine_stores.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_copy_prop_vars.c | 4 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_dead_write_vars.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_schedule.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/tests/load_store_vectorizer_tests.cpp | 7 | ||||
-rw-r--r-- | src/compiler/spirv/spirv_to_nir.c | 2 |
8 files changed, 17 insertions, 11 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 4ab620142b0..a3a85786fcd 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -2714,7 +2714,7 @@ nir_visitor::visit(ir_barrier *) } nir_intrinsic_instr *instr = - nir_intrinsic_instr_create(this->shader, nir_intrinsic_barrier); + nir_intrinsic_instr_create(this->shader, nir_intrinsic_control_barrier); nir_builder_instr_insert(&b, &instr->instr); } diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 04f58b0172b..3768016a787 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -195,7 +195,6 @@ intrinsic("get_buffer_size", src_comp=[-1], dest_comp=1, def barrier(name): intrinsic(name) -barrier("barrier") barrier("discard") # Demote fragment shader invocation to a helper invocation. Any stores to @@ -207,6 +206,12 @@ barrier("discard") barrier("demote") intrinsic("is_helper_invocation", dest_comp=1, flags=[CAN_ELIMINATE]) +# A workgroup-level control barrier. Any thread which hits this barrier will +# pause until all threads within the current workgroup have also hit the +# barrier. For compute shaders, the workgroup is defined as the local group. +# For tessellation control shaders, the workgroup is defined as the current +# patch. This intrinsic does not imply any sort of memory barrier. +barrier("control_barrier") # Memory barrier with semantics analogous to the memoryBarrier() GLSL # intrinsic. diff --git a/src/compiler/nir/nir_opt_combine_stores.c b/src/compiler/nir/nir_opt_combine_stores.c index 508833b5b46..791ec094c00 100644 --- a/src/compiler/nir/nir_opt_combine_stores.c +++ b/src/compiler/nir/nir_opt_combine_stores.c @@ -303,7 +303,7 @@ combine_stores_block(struct combine_stores_state *state, nir_block *block) update_combined_store(state, intrin); break; - case nir_intrinsic_barrier: + case nir_intrinsic_control_barrier: case nir_intrinsic_group_memory_barrier: case nir_intrinsic_memory_barrier: combine_stores_with_modes(state, nir_var_shader_out | diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c b/src/compiler/nir/nir_opt_copy_prop_vars.c index 26ca61969af..dbce55bfb8c 100644 --- a/src/compiler/nir/nir_opt_copy_prop_vars.c +++ b/src/compiler/nir/nir_opt_copy_prop_vars.c @@ -164,7 +164,7 @@ gather_vars_written(struct copy_prop_var_state *state, nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); switch (intrin->intrinsic) { - case nir_intrinsic_barrier: + case nir_intrinsic_control_barrier: case nir_intrinsic_memory_barrier: written->modes |= nir_var_shader_out | nir_var_mem_ssbo | @@ -798,7 +798,7 @@ copy_prop_vars_block(struct copy_prop_var_state *state, nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); switch (intrin->intrinsic) { - case nir_intrinsic_barrier: + case nir_intrinsic_control_barrier: case nir_intrinsic_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 ecbe77895d3..578e8706818 100644 --- a/src/compiler/nir/nir_opt_dead_write_vars.c +++ b/src/compiler/nir/nir_opt_dead_write_vars.c @@ -131,7 +131,7 @@ remove_dead_write_vars_local(void *mem_ctx, nir_block *block) nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); switch (intrin->intrinsic) { - case nir_intrinsic_barrier: + case nir_intrinsic_control_barrier: case nir_intrinsic_memory_barrier: { clear_unused_for_modes(&unused_writes, nir_var_shader_out | nir_var_mem_ssbo | diff --git a/src/compiler/nir/nir_schedule.c b/src/compiler/nir/nir_schedule.c index 0ad95a5bc89..8428f867ccc 100644 --- a/src/compiler/nir/nir_schedule.c +++ b/src/compiler/nir/nir_schedule.c @@ -347,7 +347,7 @@ nir_schedule_intrinsic_deps(nir_deps_state *state, add_write_dep(state, &state->store_shared, n); break; - case nir_intrinsic_barrier: + case nir_intrinsic_control_barrier: case nir_intrinsic_memory_barrier_shared: add_write_dep(state, &state->store_shared, n); diff --git a/src/compiler/nir/tests/load_store_vectorizer_tests.cpp b/src/compiler/nir/tests/load_store_vectorizer_tests.cpp index 0b332d8bc78..cd623704fc3 100644 --- a/src/compiler/nir/tests/load_store_vectorizer_tests.cpp +++ b/src/compiler/nir/tests/load_store_vectorizer_tests.cpp @@ -773,12 +773,13 @@ TEST_F(nir_load_store_vectorize_test, ssbo_load_adjacent_memory_barrier) ASSERT_EQ(count_intrinsics(nir_intrinsic_load_ssbo), 2); } -/* nir_intrinsic_barrier only syncs invocations in a workgroup, it doesn't - * require that loads/stores complete. */ +/* nir_intrinsic_control_barrier only syncs invocations in a workgroup, it + * doesn't require that loads/stores complete. + */ TEST_F(nir_load_store_vectorize_test, ssbo_load_adjacent_barrier) { create_load(nir_var_mem_ssbo, 0, 0, 0x1); - nir_builder_instr_insert(b, &nir_intrinsic_instr_create(b->shader, nir_intrinsic_barrier)->instr); + nir_builder_instr_insert(b, &nir_intrinsic_instr_create(b->shader, nir_intrinsic_control_barrier)->instr); create_load(nir_var_mem_ssbo, 0, 4, 0x2); nir_validate_shader(b->shader, NULL); diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 2ed2bf34875..0a0df6ba847 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -3712,7 +3712,7 @@ vtn_handle_barrier(struct vtn_builder *b, SpvOp opcode, vtn_emit_memory_barrier(b, memory_scope, memory_semantics); if (execution_scope == SpvScopeWorkgroup) - vtn_emit_barrier(b, nir_intrinsic_barrier); + vtn_emit_barrier(b, nir_intrinsic_control_barrier); break; } |