From 171fbe3ae1b0f568046813b8029757b8ccce35a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sat, 6 Feb 2021 18:40:21 +0100 Subject: [PATCH] aco: check get_reg_specified() on register hints This ensures that max_used_sgpr is adjusted accordingly. Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index fa07606e16a..2f17822e1f9 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -2409,9 +2409,9 @@ void register_allocation(Program *program, std::vector& live_out_per_bloc continue; /* find free reg */ - if (definition->hasHint() && register_file[definition->physReg()] == 0) + if (definition->hasHint() && get_reg_specified(ctx, register_file, definition->regClass(), instr, definition->physReg())) { definition->setFixed(definition->physReg()); - else if (instr->opcode == aco_opcode::p_split_vector) { + } else if (instr->opcode == aco_opcode::p_split_vector) { PhysReg reg = instr->operands[0].physReg(); for (unsigned j = 0; j < i; j++) reg.reg_b += instr->definitions[j].bytes();