diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index f5d8b226cbb..24da1c01d3c 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -2225,8 +2225,8 @@ void _aco_err(Program* program, const char* file, unsigned line, const char* fmt 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_live_changes(Instruction* instr); +RegisterDemand get_temp_registers(Instruction* instr); /* 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 757af0e3202..1e29a595c68 100644 --- a/src/amd/compiler/aco_live_var_analysis.cpp +++ b/src/amd/compiler/aco_live_var_analysis.cpp @@ -10,7 +10,7 @@ namespace aco { RegisterDemand -get_live_changes(aco_ptr& instr) +get_live_changes(Instruction* instr) { RegisterDemand changes; for (const Definition& def : instr->definitions) { @@ -40,7 +40,7 @@ get_additional_operand_demand(Instruction* instr) } RegisterDemand -get_temp_registers(aco_ptr& instr) +get_temp_registers(Instruction* instr) { RegisterDemand demand_before; RegisterDemand demand_after; @@ -60,7 +60,7 @@ get_temp_registers(aco_ptr& instr) } } - demand_before += get_additional_operand_demand(instr.get()); + demand_before += get_additional_operand_demand(instr); demand_after.update(demand_before); return demand_after; } diff --git a/src/amd/compiler/aco_scheduler.cpp b/src/amd/compiler/aco_scheduler.cpp index 12a07bbec6c..4115c0bf3d7 100644 --- a/src/amd/compiler/aco_scheduler.cpp +++ b/src/amd/compiler/aco_scheduler.cpp @@ -228,13 +228,13 @@ MoveState::downwards_move(DownwardsCursor& cursor, bool add_to_clause) } /* Check the new demand of the instructions being moved over */ - const RegisterDemand candidate_diff = get_live_changes(instr); + const RegisterDemand candidate_diff = get_live_changes(instr.get()); if (RegisterDemand(register_pressure - candidate_diff).exceeds(max_registers)) return move_fail_pressure; /* New demand for the moved instruction */ - const RegisterDemand temp = get_temp_registers(instr); - const RegisterDemand temp2 = get_temp_registers(block->instructions[dest_insert_idx - 1]); + const RegisterDemand temp = get_temp_registers(instr.get()); + const RegisterDemand temp2 = get_temp_registers(block->instructions[dest_insert_idx - 1].get()); const RegisterDemand new_demand = block->instructions[dest_insert_idx - 1]->register_demand - temp2 + temp; if (new_demand.exceeds(max_registers)) @@ -356,11 +356,12 @@ MoveState::upwards_move(UpwardsCursor& cursor) /* check if register pressure is low enough: the diff is negative if register pressure is * decreased */ - const RegisterDemand candidate_diff = get_live_changes(instr); - const RegisterDemand temp = get_temp_registers(instr); + const RegisterDemand candidate_diff = get_live_changes(instr.get()); + const RegisterDemand temp = get_temp_registers(instr.get()); if (RegisterDemand(cursor.total_demand + candidate_diff).exceeds(max_registers)) return move_fail_pressure; - const RegisterDemand temp2 = get_temp_registers(block->instructions[cursor.insert_idx - 1]); + const RegisterDemand temp2 = + get_temp_registers(block->instructions[cursor.insert_idx - 1].get()); const RegisterDemand new_demand = block->instructions[cursor.insert_idx - 1]->register_demand - temp2 + candidate_diff + temp; if (new_demand.exceeds(max_registers))