From 4e459df0fcb42cfb7223e15ffd7e20bcc9b16e75 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 3 May 2021 14:21:59 +0100 Subject: [PATCH] aco/ra: initialize temp_in_scc earlier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to know if there's a temporary in SCC before the instruction, not after. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Fixes: 93c8ebfa780 ("aco: Initial commit of independent AMD compiler") Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index e3679cef158..d7e64f88a89 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -2270,6 +2270,8 @@ void register_allocation(Program *program, std::vector& live_out_per_bloc assert(!is_phi(instr)); + bool temp_in_scc = register_file[scc]; + /* handle operands */ for (unsigned i = 0; i < instr->operands.size(); ++i) { auto& operand = instr->operands[i]; @@ -2484,7 +2486,6 @@ void register_allocation(Program *program, std::vector& live_out_per_bloc if (!parallelcopy.empty()) { aco_ptr pc; pc.reset(create_instruction(aco_opcode::p_parallelcopy, Format::PSEUDO, parallelcopy.size(), parallelcopy.size())); - bool temp_in_scc = register_file[scc]; bool sgpr_operands_alias_defs = false; uint64_t sgpr_operands[4] = {0, 0, 0, 0}; for (unsigned i = 0; i < parallelcopy.size(); i++) {