aco: don't remove branches that skip v_writelane_b32

Cc: mesa-stable

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27537>
(cherry picked from commit cd6d9c5918)
This commit is contained in:
Georg Lehmann
2024-02-08 22:30:38 +01:00
committed by Eric Engestrom
parent 9e8d339fab
commit 73a46e084d
2 changed files with 6 additions and 1 deletions

View File

@@ -2114,7 +2114,7 @@
"description": "aco: don't remove branches that skip v_writelane_b32",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View File

@@ -2922,6 +2922,11 @@ lower_to_hw_instr(Program* program)
} else if (inst->isSALU()) {
num_scalar++;
} else if (inst->isVALU() || inst->isVINTRP()) {
if (instr->opcode == aco_opcode::v_writelane_b32 ||
instr->opcode == aco_opcode::v_writelane_b32_e64) {
/* writelane ignores exec, writing inactive lanes results in UB. */
can_remove = false;
}
num_vector++;
/* VALU which writes SGPRs are always executed on GFX10+ */
if (ctx.program->gfx_level >= GFX10) {