summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Perry <[email protected]>2020-01-31 12:40:51 +0000
committerEric Engestrom <[email protected]>2020-03-25 15:32:18 +0100
commitcb7517be47c27478f5c12180c8ea0e8cf05d5104 (patch)
tree44e0b18e644f8a23e6a2df1c1239a7cf14b749a9
parent4c2f8b3dd6a2560b6b7b40be685ae728a2c3784f (diff)
aco: set has_divergent_branch for discards in loops
Signed-off-by: Rhys Perry <[email protected]> CC: <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3658> (cherry picked from commit f1a2e1df7882e9d3816f28d6a0827d4ac66ac8f6)
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/compiler/aco_instruction_selection.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 2466e1e097c..2b97427be4b 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -508,7 +508,7 @@
"description": "aco: set has_divergent_branch for discards in loops",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index c5bb4f12dba..8abcb878bfb 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -3958,6 +3958,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();