aco: don't assume that demote doesn't cause an empty exec mask

Totals from 188 (0.24% of 79377) affected shaders: (Navi31)
Instrs: 209239 -> 209473 (+0.11%); split: -0.01%, +0.12%
CodeSize: 1101124 -> 1101744 (+0.06%); split: -0.02%, +0.07%
Latency: 1672182 -> 1672748 (+0.03%); split: -0.11%, +0.14%
InvThroughput: 237276 -> 237546 (+0.11%); split: -0.00%, +0.12%
SClause: 5694 -> 5690 (-0.07%); split: -0.28%, +0.21%
Copies: 21685 -> 21682 (-0.01%); split: -0.12%, +0.10%
Branches: 5740 -> 5863 (+2.14%)
PreSGPRs: 7004 -> 7034 (+0.43%)
VALU: 123595 -> 123641 (+0.04%); split: -0.00%, +0.04%
SALU: 28418 -> 28411 (-0.02%); split: -0.09%, +0.06%

Fixes: f35e229fae ('aco: skip code if exec is empty')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33619>
(cherry picked from commit 69dcd5be3a)
This commit is contained in:
Daniel Schürmann 2025-02-18 14:21:23 +01:00 committed by Eric Engestrom
parent 69d6923cdb
commit e159e0000c
2 changed files with 6 additions and 1 deletions

View file

@ -1674,7 +1674,7 @@
"description": "aco: don't assume that demote doesn't cause an empty exec mask",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "f35e229faedb5e19da49846eed119d82228c5d5a",
"notes": null

View file

@ -8646,6 +8646,11 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
if (ctx->shader->info.maximally_reconverges)
ctx->program->needs_wqm = true;
if (ctx->block->loop_nest_depth || ctx->cf_info.parent_if.is_divergent) {
ctx->cf_info.exec.potentially_empty_discard = true;
begin_empty_exec_skip(ctx, &instr->instr, instr->instr.block);
}
break;
}
case nir_intrinsic_terminate: