aco: set has_divergent_branch for discards in loops
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 31 Jan 2020 12:40:51 +0000 (12:40 +0000)
committerMarge Bot <eric+marge@anholt.net>
Mon, 23 Mar 2020 15:55:12 +0000 (15:55 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3658>

src/amd/compiler/aco_instruction_selection.cpp

index 29d40d18b2555fd5af1cda1aaa254edc6c2ac853..7b429f69350a65593c2877cad81d9fc47f26a6e3 100644 (file)
@@ -4462,6 +4462,9 @@ void visit_discard(isel_context* ctx, nir_intrinsic_instr *instr)
       ctx->block->kind |= block_kind_break;
       unsigned idx = ctx->block->index;
 
+      ctx->cf_info.parent_loop.has_divergent_branch = true;
+      ctx->cf_info.nir_to_aco[instr->instr.block->index] = idx;
+
       /* remove critical edges from linear CFG */
       bld.branch(aco_opcode::p_branch);
       Block* break_block = ctx->program->create_and_insert_block();