mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 00:38:48 +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
(cherry picked from commit 60b3e5b3f0)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40979>
This commit is contained in:
parent
7809c26b56
commit
b4cfec4973
2 changed files with 5 additions and 1 deletions
|
|
@ -2114,7 +2114,7 @@
|
|||
"description": "aco/lower_branches: Don't remove branches which jump over loops",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -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