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>
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" */
}
}
+ 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()) {