diff options
author | Daniel Schürmann <daniel@schuermann.dev> | 2021-05-19 15:42:10 +0200 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-05-20 17:44:20 +0000 |
commit | 32c7d17120f5af567df13faa69402f84478522ae (patch) | |
tree | c4d224964ff847531338718558ecb979a0938dc8 | |
parent | 2bb1bf78f0779db6679b2efe89fedd478aca9750 (diff) |
aco: remove condition operand from branch in invert block
As value numbering only handles logical blocks, this
could lead to invalid IR until insert_exec_mask().
No fossil-db changes.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10894>
-rw-r--r-- | src/amd/compiler/aco_insert_exec_mask.cpp | 2 | ||||
-rw-r--r-- | src/amd/compiler/aco_instruction_selection.cpp | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/amd/compiler/aco_insert_exec_mask.cpp b/src/amd/compiler/aco_insert_exec_mask.cpp index 0339acb472b..5f457a285f0 100644 --- a/src/amd/compiler/aco_insert_exec_mask.cpp +++ b/src/amd/compiler/aco_insert_exec_mask.cpp @@ -983,7 +983,7 @@ void add_branch_code(exec_ctx& ctx, Block* block) if (block->kind & block_kind_invert) { // exec = s_andn2_b64 (original_exec, exec) - assert(block->instructions.back()->opcode == aco_opcode::p_cbranch_nz); + assert(block->instructions.back()->opcode == aco_opcode::p_branch); block->instructions.pop_back(); assert(ctx.info[idx].exec.size() >= 2); Operand orig_exec = ctx.info[idx].exec[ctx.info[idx].exec.size() - 2].first; diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 81d6779a937..8ae43af5f97 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -9973,10 +9973,9 @@ static void begin_divergent_if_else(isel_context *ctx, if_context *ic) ic->invert_idx = ctx->block->index; /* branch to linear else block (skip else) */ - branch.reset(create_instruction<Pseudo_branch_instruction>(aco_opcode::p_cbranch_nz, Format::PSEUDO_BRANCH, 1, 1)); + branch.reset(create_instruction<Pseudo_branch_instruction>(aco_opcode::p_branch, Format::PSEUDO_BRANCH, 0, 1)); branch->definitions[0] = Definition(ctx->program->allocateTmp(s2)); branch->definitions[0].setHint(vcc); - branch->operands[0] = Operand(ic->cond); ctx->block->instructions.push_back(std::move(branch)); ic->exec_potentially_empty_discard_old |= ctx->cf_info.exec_potentially_empty_discard; |