From dce1d4ad4cbae33b26322263a87af411d19128b1 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 30 Jun 2025 17:12:49 +0100 Subject: [PATCH] aco/ra: fix repeated compact_linear_vgprs() in get_reg() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Fixes: b7738de4f93e ("aco/ra: rework linear VGPR allocation") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13431 Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 62153a89a39..29340a28ab3 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -1934,12 +1934,14 @@ get_reg(ra_ctx& ctx, const RegisterFile& reg_file, Temp temp, compact_linear_vgprs(ctx, reg_file, pc)) { parallelcopies.insert(parallelcopies.end(), pc.begin(), pc.end()); - /* We don't need to fill the copy definitions in because we don't care about the linear VGPR - * space here. */ RegisterFile tmp_file(reg_file); for (parallelcopy& copy : pc) tmp_file.clear(copy.op); + /* Block these registers in case we try compacting linear VGPRs in the recursive get_reg(). */ + for (parallelcopy& copy : pc) + tmp_file.block(copy.def.physReg(), copy.def.regClass()); + return get_reg(ctx, tmp_file, temp, parallelcopies, instr, operand_index); }