aco/insert_exec_mask: ensure top mask is not a temporary at loop exits

This is problematic when the successor of the loop exit is an invert
block. It assumes that the top mask is Operand(bld.lm) and doesn't change
it when entering the else branch.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11348
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29767>
(cherry picked from commit 71afacff39)
This commit is contained in:
Rhys Perry 2024-06-18 14:15:04 +01:00 committed by Eric Engestrom
parent de8982ba71
commit bf86fa1b7d
2 changed files with 2 additions and 1 deletions

View file

@ -1014,7 +1014,7 @@
"description": "aco/insert_exec_mask: ensure top mask is not a temporary at loop exits",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -270,6 +270,7 @@ add_coupling_code(exec_ctx& ctx, Block* block, std::vector<aco_ptr<Instruction>>
for (unsigned i = 1; i < phi->operands.size(); i++)
phi->operands[i] =
get_exec_op(ctx.info[header_preds[i]].exec[info.num_exec_masks - 1].first);
restore_exec = true;
}
if (info.has_divergent_break) {