From 5cfa5b784bdc1c7658a173349deaa57be87f27f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 20 Jun 2024 10:23:47 +0200 Subject: [PATCH] aco: remove get_demand_before() The register demand before executing an instruction is now included in the instruction's register demand and this function is unused. Part-of: --- src/amd/compiler/aco_ir.h | 2 -- src/amd/compiler/aco_live_var_analysis.cpp | 11 ----------- src/amd/compiler/aco_spill.cpp | 13 ------------- 3 files changed, 26 deletions(-) diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index fe36cdba829..5a917c4a879 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -2227,8 +2227,6 @@ int get_op_fixed_to_def(Instruction* instr); /* utilities for dealing with register demand */ RegisterDemand get_live_changes(aco_ptr& instr); RegisterDemand get_temp_registers(aco_ptr& instr); -RegisterDemand get_demand_before(RegisterDemand demand, aco_ptr& instr, - aco_ptr& instr_before); /* number of sgprs that need to be allocated but might notbe addressable as s0-s105 */ uint16_t get_extra_sgprs(Program* program); diff --git a/src/amd/compiler/aco_live_var_analysis.cpp b/src/amd/compiler/aco_live_var_analysis.cpp index 7dbb849081f..5aeba8aa0d8 100644 --- a/src/amd/compiler/aco_live_var_analysis.cpp +++ b/src/amd/compiler/aco_live_var_analysis.cpp @@ -75,17 +75,6 @@ get_temp_registers(aco_ptr& instr) return demand_after; } -RegisterDemand -get_demand_before(RegisterDemand demand, aco_ptr& instr, - aco_ptr& instr_before) -{ - demand -= get_live_changes(instr); - demand -= get_temp_registers(instr); - if (instr_before) - demand += get_temp_registers(instr_before); - return demand; -} - namespace { struct PhiInfo { uint16_t logical_phi_sgpr_ops = 0; diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp index 59ffdf3fab5..0926508555f 100644 --- a/src/amd/compiler/aco_spill.cpp +++ b/src/amd/compiler/aco_spill.cpp @@ -295,19 +295,6 @@ get_rematerialize_info(spill_ctx& ctx) } } -RegisterDemand -get_demand_before(spill_ctx& ctx, unsigned block_idx, unsigned idx) -{ - if (idx == 0) { - RegisterDemand demand = ctx.program->live.register_demand[block_idx][idx]; - aco_ptr& instr = ctx.program->blocks[block_idx].instructions[idx]; - aco_ptr instr_before(nullptr); - return get_demand_before(demand, instr, instr_before); - } else { - return ctx.program->live.register_demand[block_idx][idx - 1]; - } -} - RegisterDemand init_live_in_vars(spill_ctx& ctx, Block* block, unsigned block_idx) {