From b92134e088cfe0dad36d83f5a197875bdd644745 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sun, 28 Jul 2024 14:00:29 +0200 Subject: [PATCH] aco: validate temp_rc Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_validate.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp index f3c5bfddac3..40a90e32a2b 100644 --- a/src/amd/compiler/aco_validate.cpp +++ b/src/amd/compiler/aco_validate.cpp @@ -77,6 +77,16 @@ validate_ir(Program* program) for (Block& block : program->blocks) { for (aco_ptr& instr : block.instructions) { + if (program->progress < CompilationProgress::after_lower_to_hw) { + for (const Operand& op : instr->operands) + check(!op.isTemp() || op.regClass() == program->temp_rc[op.tempId()], + "Operand RC not consistent.", instr.get()); + + for (const Definition& def : instr->definitions) + check(!def.isTemp() || def.regClass() == program->temp_rc[def.tempId()], + "Definition RC not consistent.", instr.get()); + } + unsigned pck_defs = instr_info.definitions[(int)instr->opcode]; unsigned pck_ops = instr_info.operands[(int)instr->opcode];