From 4fad3514a9e64e0492a822a807898986f8a2c61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Mon, 28 Apr 2025 10:41:53 +0200 Subject: [PATCH] aco/ra: only change registers of already handled operands in update_renames() Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index d531dbb1def..f6de4c82b6d 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -901,7 +901,8 @@ update_renames(ra_ctx& ctx, RegisterFile& reg_file, std::vector& p for (Operand& op : instr->operands) { if (op.isTemp() && op.tempId() == other.def.tempId()) { // FIXME: ensure that the operand can use this reg - op.setFixed(other.def.physReg()); + if (op.isFixed()) + op.setFixed(other.def.physReg()); fill = !op.isKillBeforeDef(); } } @@ -947,7 +948,8 @@ update_renames(ra_ctx& ctx, RegisterFile& reg_file, std::vector& p continue; op.setTemp(copy.def.getTemp()); - op.setFixed(copy.def.physReg()); + if (op.isFixed()) + op.setFixed(copy.def.physReg()); /* Copy-kill or precolored operand parallelcopies are only added when setting up * operands. @@ -2311,6 +2313,7 @@ get_reg_for_operand(ra_ctx& ctx, RegisterFile& register_file, parallelcopy.emplace_back(pc_op, pc_def); update_renames(ctx, register_file, parallelcopy, instr); register_file.fill(Definition(operand.getTemp(), dst)); + operand.setFixed(dst); } PhysReg