aco/scheduler: enable live variables validation when ACO_DEBUG=validate-livevars is set

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30182>
This commit is contained in:
Daniel Schürmann 2024-07-04 16:08:46 +02:00 committed by Marge Bot
parent b0c8c5e42e
commit e5d920e0b9

View file

@ -1287,33 +1287,9 @@ schedule_program(Program* program)
}
update_vgpr_sgpr_demand(program, new_demand);
/* if enabled, this code asserts that register_demand is updated correctly */
#if 0
int prev_num_waves = program->num_waves;
const RegisterDemand prev_max_demand = program->max_reg_demand;
std::vector<RegisterDemand> block_demands(program->blocks.size());
std::vector<std::vector<RegisterDemand>> register_demands(program->blocks.size());
for (unsigned j = 0; j < program->blocks.size(); j++) {
Block &b = program->blocks[j];
block_demands[j] = b.register_demand;
register_demands[j].reserve(b.instructions.size());
for (unsigned i = 0; i < b.instructions.size(); i++)
register_demands[j].emplace_back(b.instructions[i]->register_demand);
}
aco::live_var_analysis(program);
for (unsigned j = 0; j < program->blocks.size(); j++) {
Block &b = program->blocks[j];
for (unsigned i = 0; i < b.instructions.size(); i++)
assert(register_demands[j][i] == b.instructions[i]->register_demand);
assert(b.register_demand == block_demands[j]);
}
assert(program->max_reg_demand == prev_max_demand);
assert(program->num_waves == prev_num_waves);
#endif
/* Validate live variable information */
if (!validate_live_vars(program))
abort();
}
} // namespace aco