From b53dc3f0529c4eff362b8694167c9b1a8df96412 Mon Sep 17 00:00:00 2001 From: Natalie Vock Date: Tue, 7 Apr 2026 12:17:13 +0200 Subject: [PATCH] aco/lower_to_hw_instr: Run p_init_scratch if the program has a call Callees may use scratch even if the caller doesn't. Part-of: --- src/amd/compiler/aco_lower_to_hw_instr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_lower_to_hw_instr.cpp b/src/amd/compiler/aco_lower_to_hw_instr.cpp index 57c201b4867..09a8a6ee02e 100644 --- a/src/amd/compiler/aco_lower_to_hw_instr.cpp +++ b/src/amd/compiler/aco_lower_to_hw_instr.cpp @@ -2746,7 +2746,7 @@ lower_to_hw_instr(Program* program) } case aco_opcode::p_init_scratch: { assert(program->gfx_level >= GFX8 && program->gfx_level <= GFX10_3); - if (!program->config->scratch_bytes_per_wave) + if (!program->config->scratch_bytes_per_wave && !program->has_call) break; Operand scratch_addr = instr->operands[0];