aco: preserve SSA in try_eliminate_scc_copy

Otherwise, there is no definition of this temporary. Fixes fail in future
validation.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30440>
This commit is contained in:
Rhys Perry
2024-07-30 21:58:58 +01:00
committed by Marge Bot
parent d81d5b7d00
commit 39270a8be3

View File

@@ -523,6 +523,7 @@ try_eliminate_scc_copy(pr_opt_ctx& ctx, aco_ptr<Instruction>& instr)
}
/* Duplicate the original producer of the SCC */
Definition scc_def = instr->definitions[0];
instr.reset(create_instruction(producer_instr->opcode, producer_instr->format,
producer_instr->operands.size(),
producer_instr->definitions.size()));
@@ -545,6 +546,7 @@ try_eliminate_scc_copy(pr_opt_ctx& ctx, aco_ptr<Instruction>& instr)
for (unsigned i = 0; i < producer_instr->definitions.size(); ++i)
instr->definitions[i] = Definition(producer_instr->definitions[i].physReg(),
producer_instr->definitions[i].regClass());
instr->definitions.back() = scc_def; /* Keep temporary ID. */
}
void