From e85fc0f869cbc08f0355c58f6cc48de6b4dcccf0 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 4 Nov 2024 11:57:23 +0100 Subject: [PATCH] aco: fix validation for VOP1 instructions without any dest/src Like v_clrexcp. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/compiler/aco_validate.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp index 09567ac20be..c65c255d8db 100644 --- a/src/amd/compiler/aco_validate.cpp +++ b/src/amd/compiler/aco_validate.cpp @@ -379,7 +379,8 @@ validate_ir(Program* program) instr->operands[i].regClass().is_subdword() && !instr->operands[i].isFixed())) check(!valu.opsel[i], "Unexpected opsel for operand", instr.get()); } - if (instr->definitions[0].regClass().is_subdword() && !instr->definitions[0].isFixed()) + if (!instr->definitions.empty() && instr->definitions[0].regClass().is_subdword() && + !instr->definitions[0].isFixed()) check(!valu.opsel[3], "Unexpected opsel for sub-dword definition", instr.get()); } else if (instr->opcode == aco_opcode::v_fma_mixlo_f16 || instr->opcode == aco_opcode::v_fma_mixhi_f16 || @@ -493,8 +494,9 @@ validate_ir(Program* program) check(instr->definitions[0].regClass().type() == RegType::sgpr, "Wrong Definition type for VALU instruction", instr.get()); } else { - check(instr->definitions[0].regClass().type() == RegType::vgpr, - "Wrong Definition type for VALU instruction", instr.get()); + if (!instr->definitions.empty()) + check(instr->definitions[0].regClass().type() == RegType::vgpr, + "Wrong Definition type for VALU instruction", instr.get()); } unsigned num_sgprs = 0;