From 5b8a4516e6bd384ef20624624d0139931dc23037 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 14 Apr 2021 14:48:33 +0100 Subject: [PATCH] aco/ra: remove live-in temporary from live_out_per_block when moving it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, handle_loop_phis() might pass it to handle_live_in() and then we could have two phis for this variable. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Fixes: 7c64623e948 ("aco/ra: refactor SSA repairing during register allocation") Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 4d6d683b902..413d3f06172 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -2200,6 +2200,11 @@ void register_allocation(Program *program, std::vector& live_out_per_bloc for (unsigned i = 0; i < preds.size(); i++) new_phi->operands[i] = Operand(pc.first); instructions.emplace_back(std::move(new_phi)); + + /* Remove from live_out_per_block (now used for live-in), because handle_loop_phis() + * would re-create this phi later if this is a loop header. + */ + live_out_per_block[block.index].erase(orig.id()); } register_file.fill(definition);