From ec74e346721b6c7df7ea2006fac0ad9cbad4aabb Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 27 Jan 2026 16:30:52 +0000 Subject: [PATCH] aco: add return address to call_clobbered_regs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's better for handle_call() to make sure these SGPRs are clear. Signed-off-by: Rhys Perry Reviewed-by: Natalie Vock Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index e5e1961051e..4ebffbece69 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -3954,6 +3954,9 @@ register_allocation(Program* program, ra_test_policy policy) } BITSET_NOT(call_clobbered_regs); + BITSET_SET(call_clobbered_regs, instr->definitions[0].physReg().reg()); + BITSET_SET(call_clobbered_regs, instr->definitions[0].physReg().reg() + 1); + /* Allow linear VGPRs in the clobbered range. * Linear VGPRs are spilled in spill_preserved, and the stack pointer is always * guaranteed to be preserved.