aco/wave32: Use wave_size for barrier intrinsic.
authorTimur Kristóf <timur.kristof@gmail.com>
Fri, 22 Nov 2019 16:07:34 +0000 (17:07 +0100)
committerDaniel Schürmann <daniel@schuermann.dev>
Wed, 4 Dec 2019 10:36:01 +0000 (10:36 +0000)
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
src/amd/compiler/aco_insert_waitcnt.cpp
src/amd/compiler/aco_instruction_selection.cpp

index 7960902d6907361efdc6fc27db505d015ef861f3..a8343d1889430dbac6a3f99e079f628d829fd1c0 100644 (file)
@@ -399,7 +399,7 @@ wait_imm kill(Instruction* instr, wait_ctx& ctx)
       switch (instr->opcode) {
       case aco_opcode::p_memory_barrier_all:
          for (unsigned i = 0; i < barrier_count; i++) {
-            if ((1 << i) == barrier_shared && workgroup_size <= 64)
+            if ((1 << i) == barrier_shared && workgroup_size <= ctx.program->wave_size)
                continue;
             imm.combine(ctx.barrier_imm[i]);
          }
@@ -414,7 +414,7 @@ wait_imm kill(Instruction* instr, wait_ctx& ctx)
          imm.combine(ctx.barrier_imm[ffs(barrier_image) - 1]);
          break;
       case aco_opcode::p_memory_barrier_shared:
-         if (workgroup_size > 64)
+         if (workgroup_size > ctx.program->wave_size)
             imm.combine(ctx.barrier_imm[ffs(barrier_shared) - 1]);
          break;
       default:
index 3d061bbb448254638d3bd1cfbb1fb051c4fe2cc8..70cee2256707705936faf7cfae8152b581072a75 100644 (file)
@@ -5631,7 +5631,7 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr)
    case nir_intrinsic_barrier: {
       unsigned* bsize = ctx->program->info->cs.block_size;
       unsigned workgroup_size = bsize[0] * bsize[1] * bsize[2];
-      if (workgroup_size > 64)
+      if (workgroup_size > ctx->program->wave_size)
          bld.sopp(aco_opcode::s_barrier);
       break;
    }