nir: add missing group_memory_barrier handling
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 4 May 2020 17:54:11 +0000 (18:54 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 5 May 2020 18:34:02 +0000 (18:34 +0000)
Totals from 2 (0.00% of 127638) affected shaders:
VGPRs: 164 -> 168 (+2.44%)
CodeSize: 18420 -> 18756 (+1.82%)
Instrs: 3658 -> 3700 (+1.15%)
Cycles: 82912 -> 83080 (+0.20%)
VMEM: 70 -> 69 (-1.43%)
PreVGPRs: 155 -> 168 (+8.39%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
CC: <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4889>

src/compiler/nir/nir_opt_copy_prop_vars.c
src/compiler/nir/nir_opt_dead_write_vars.c

index bfbbb4cd55edea72715cc4f62bfceb927f9a69d5..77bf2c94dde928f4b2fecb21bc65a0af90aa447f 100644 (file)
@@ -166,6 +166,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_control_barrier:
+         case nir_intrinsic_group_memory_barrier:
          case nir_intrinsic_memory_barrier:
             written->modes |= nir_var_shader_out |
                               nir_var_mem_ssbo |
index 5a8e2ffaaa01ba77b11e69c9e08d740e3949a907..c77b56a476caf09b79db85ebe5d5c40a8018fcb4 100644 (file)
@@ -133,6 +133,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_control_barrier:
+      case nir_intrinsic_group_memory_barrier:
       case nir_intrinsic_memory_barrier: {
          clear_unused_for_modes(&unused_writes, nir_var_shader_out |
                                                 nir_var_mem_ssbo |