From bf56f1efd34b2153ae239f9eb5757ad9669e69f3 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 16 Jan 2026 11:24:31 +0000 Subject: [PATCH] aco: move update(fixed_reg_demand) into update_vgpr_sgpr_demand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_live_var_analysis.cpp | 6 +++--- src/amd/compiler/aco_scheduler.cpp | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/amd/compiler/aco_live_var_analysis.cpp b/src/amd/compiler/aco_live_var_analysis.cpp index 27a4c6958dd..a2e6f738945 100644 --- a/src/amd/compiler/aco_live_var_analysis.cpp +++ b/src/amd/compiler/aco_live_var_analysis.cpp @@ -680,7 +680,7 @@ max_suitable_waves(Program* program, uint16_t waves) } void -update_vgpr_sgpr_demand(Program* program, const RegisterDemand new_demand) +update_vgpr_sgpr_demand(Program* program, RegisterDemand new_demand) { assert(program->min_waves >= 1); RegisterDemand limit = get_addr_regs_from_waves(program, program->min_waves); @@ -690,6 +690,8 @@ update_vgpr_sgpr_demand(Program* program, const RegisterDemand new_demand) program->num_waves = 0; program->max_reg_demand = new_demand; } else { + new_demand.update(program->fixed_reg_demand); + program->num_waves = program->dev.physical_sgprs / get_sgpr_alloc(program, new_demand.sgpr); uint16_t vgpr_demand = get_vgpr_alloc(program, new_demand.vgpr) + program->config->num_shared_vgprs / 2; @@ -725,8 +727,6 @@ live_var_analysis(Program* program) process_live_temps_per_block(ctx, &program->blocks[ctx.worklist--]); } - program->max_reg_demand.update(program->fixed_reg_demand); - /* calculate the program's register demand and number of waves */ if (program->progress < CompilationProgress::after_ra) update_vgpr_sgpr_demand(program, program->max_reg_demand); diff --git a/src/amd/compiler/aco_scheduler.cpp b/src/amd/compiler/aco_scheduler.cpp index 8e8014fcbd1..95d62f6b0f1 100644 --- a/src/amd/compiler/aco_scheduler.cpp +++ b/src/amd/compiler/aco_scheduler.cpp @@ -1354,7 +1354,6 @@ schedule_program(Program* program) for (Block& block : program->blocks) { new_demand.update(block.register_demand); } - new_demand.update(program->fixed_reg_demand); assert(!new_demand.exceeds(ctx.mv.max_registers) || !new_demand.exceeds(program->max_reg_demand)); update_vgpr_sgpr_demand(program, new_demand);