mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
aco/lower_branches: Don't remove branches which jump over loops
Entering a loop with empty exec mask might lead to not be able to execute the break condition and lead to infinite loops. Totals from 81 (0.04% of 202440) affected shaders: (Navi48) Instrs: 3040566 -> 3040716 (+0.00%) CodeSize: 17506768 -> 17507188 (+0.00%) Latency: 16342966 -> 16345166 (+0.01%) InvThroughput: 3112932 -> 3113286 (+0.01%) Branches: 82229 -> 82365 (+0.17%) Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40628>
This commit is contained in:
parent
373498bf7e
commit
60b3e5b3f0
1 changed files with 4 additions and 0 deletions
|
|
@ -379,6 +379,10 @@ can_remove_branch(branch_ctx& ctx, Block& block, Pseudo_branch_instruction* bran
|
|||
if (uniform_branch && !ctx.program->blocks[i].instructions.empty())
|
||||
return false;
|
||||
|
||||
/* Don't enter loops with empty exec mask. */
|
||||
if (ctx.program->blocks[i].loop_nest_depth > block.loop_nest_depth)
|
||||
return false;
|
||||
|
||||
for (aco_ptr<Instruction>& instr : ctx.program->blocks[i].instructions) {
|
||||
if (instr->isSOPP()) {
|
||||
/* Discard early exits and loop breaks and continues should work fine with
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue