mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 17:40:11 +01:00
aco: allow p_exit_early_if_not with exec condition
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Daniel Schürmann <None> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32731>
This commit is contained in:
parent
c279e63a79
commit
6b35d6f75b
2 changed files with 8 additions and 3 deletions
|
|
@ -78,7 +78,9 @@ can_remove_branch(branch_ctx& ctx, Block& block, Pseudo_branch_instruction* bran
|
||||||
* an empty exec mask.
|
* an empty exec mask.
|
||||||
*/
|
*/
|
||||||
if (instr->opcode == aco_opcode::s_cbranch_scc0 ||
|
if (instr->opcode == aco_opcode::s_cbranch_scc0 ||
|
||||||
instr->opcode == aco_opcode::s_cbranch_scc1) {
|
instr->opcode == aco_opcode::s_cbranch_scc1 ||
|
||||||
|
instr->opcode == aco_opcode::s_cbranch_execz ||
|
||||||
|
instr->opcode == aco_opcode::s_cbranch_execnz) {
|
||||||
bool is_break_continue =
|
bool is_break_continue =
|
||||||
ctx.program->blocks[i].kind & (block_kind_break | block_kind_continue);
|
ctx.program->blocks[i].kind & (block_kind_break | block_kind_continue);
|
||||||
bool discard_early_exit =
|
bool discard_early_exit =
|
||||||
|
|
|
||||||
|
|
@ -2427,8 +2427,11 @@ lower_to_hw_instr(Program* program)
|
||||||
bld.reset(&ctx.instructions);
|
bld.reset(&ctx.instructions);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(instr->operands[0].physReg() == scc);
|
assert(instr->operands[0].physReg() == scc || instr->operands[0].physReg() == exec);
|
||||||
|
if (instr->operands[0].physReg() == scc)
|
||||||
bld.sopp(aco_opcode::s_cbranch_scc0, discard_block->index);
|
bld.sopp(aco_opcode::s_cbranch_scc0, discard_block->index);
|
||||||
|
else
|
||||||
|
bld.sopp(aco_opcode::s_cbranch_execz, discard_block->index);
|
||||||
|
|
||||||
discard_block->linear_preds.push_back(block->index);
|
discard_block->linear_preds.push_back(block->index);
|
||||||
block->linear_succs.push_back(discard_block->index);
|
block->linear_succs.push_back(discard_block->index);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue