diff --git a/.pick_status.json b/.pick_status.json index 84e6df4907e..f50a106538d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1570,7 +1570,7 @@ "description": "aco/ra: remove live-in temporary from live_out_per_block when moving it", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "7c64623e9489a37297808f7346e6e80bd1c78587" }, 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);