summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schürmann <daniel@schuermann.dev>2020-08-10 16:56:25 +0200
committerDylan Baker <dylan.c.baker@intel.com>2020-08-11 09:43:35 -0700
commitb454e445796bcfd928f06b6ac205b478b77df09d (patch)
treefe126282c32fe4330ca0e8185fd175ccc2e3c9d0
parentee63146f37f1e51271934fec312b1266e0b5a464 (diff)
aco: execute branch instructions in WQM if necessary
It could happen that only the branch condition was computed in WQM and not the branch instruction. There is now some rendundancy which should be cleaned up. Fixes: 3817fa7a4d1f51c385b28a2e45a1edf227526028 ('aco: fix WQM handling in nested loops') Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6260> (cherry picked from commit fdb97d3d2914c8f887a7968432db4fdbd35d8376)
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/compiler/aco_insert_exec_mask.cpp11
2 files changed, 6 insertions, 7 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 15bf5779c57..471179130ee 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4,7 +4,7 @@
"description": "aco: execute branch instructions in WQM if necessary",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "3817fa7a4d1f51c385b28a2e45a1edf227526028"
},
diff --git a/src/amd/compiler/aco_insert_exec_mask.cpp b/src/amd/compiler/aco_insert_exec_mask.cpp
index 7246fb74e0c..ccdd5c7d2aa 100644
--- a/src/amd/compiler/aco_insert_exec_mask.cpp
+++ b/src/amd/compiler/aco_insert_exec_mask.cpp
@@ -165,12 +165,6 @@ void mark_block_wqm(wqm_ctx &ctx, unsigned block_idx)
ctx.branch_wqm[block_idx] = true;
Block& block = ctx.program->blocks[block_idx];
- aco_ptr<Instruction>& branch = block.instructions.back();
-
- if (branch->opcode != aco_opcode::p_branch) {
- assert(!branch->operands.empty() && branch->operands[0].isTemp());
- set_needs_wqm(ctx, branch->operands[0].getTemp());
- }
/* TODO: this sets more branch conditions to WQM than it needs to
* it should be enough to stop at the "exec mask top level" */
@@ -233,6 +227,11 @@ void get_block_needs(wqm_ctx &ctx, exec_ctx &exec_ctx, Block* block)
}
}
+ if (instr->format == Format::PSEUDO_BRANCH && ctx.branch_wqm[block->index]) {
+ needs = WQM;
+ propagate_wqm = true;
+ }
+
if (propagate_wqm) {
for (const Operand& op : instr->operands) {
if (op.isTemp()) {