diff --git a/lib/SPIRV/libSPIRV/SPIRVInstruction.h b/lib/SPIRV/libSPIRV/SPIRVInstruction.h index 50d5abea83..fcf08720ba 100644 --- a/lib/SPIRV/libSPIRV/SPIRVInstruction.h +++ b/lib/SPIRV/libSPIRV/SPIRVInstruction.h @@ -3346,7 +3346,7 @@ class SPIRVBfloat16ConversionINTELInstBase : public SPIRVUnaryInst { "cooperative matrices only when SPV_INTEL_joint_matrix is " "enabled\n"); assert(InCompTy->isTypeCooperativeMatrixKHR() && - "Input must also be a matrix"); + "Input must also be a cooperative matrix"); ResCompTy = static_cast(ResCompTy) ->getCompType(); InCompTy = @@ -3755,7 +3755,7 @@ class SPIRVTensorFloat32RoundingINTELInstBase : public SPIRVUnaryInst { "cooperative matrices only when SPV_INTEL_joint_matrix is " "enabled\n"); assert(InCompTy->isTypeCooperativeMatrixKHR() && - "Input must also be a matrix"); + "Input must also be a cooperative matrix"); ResCompTy = static_cast(ResCompTy) ->getCompType(); InCompTy = diff --git a/test/extensions/INTEL/SPV_INTEL_joint_matrix/bf16_conversion_instructions.ll b/test/extensions/INTEL/SPV_INTEL_joint_matrix/bf16_conversion_instructions.ll index 79f06d73b3..eb1d1afe51 100644 --- a/test/extensions/INTEL/SPV_INTEL_joint_matrix/bf16_conversion_instructions.ll +++ b/test/extensions/INTEL/SPV_INTEL_joint_matrix/bf16_conversion_instructions.ll @@ -9,6 +9,13 @@ ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc --spirv-target-env=SPV-IR ; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-SPV-IR +; RUN: not llvm-spirv %t.bc --spirv-ext=+SPV_KHR_cooperative_matrix,+SPV_INTEL_bfloat16_conversion 2>&1 \ +; RUN: | FileCheck %s --check-prefix=CHECK-ERROR + +; CHECK-ERROR: InvalidInstruction: Can't translate llvm instruction: +; CHECK-ERROR-NEXT: ConvertFToBF16INTEL +; CHECK-ERROR-NEXT: Can be used with cooperative matrices only when SPV_INTEL_joint_matrix is enabled + ; CHECK-SPIRV-DAG: Capability CooperativeMatrixKHR ; CHECK-SPIRV-DAG: Capability Bfloat16ConversionINTEL ; CHECK-SPIRV-DAG: Capability JointMatrixBF16ComponentTypeINTEL diff --git a/test/extensions/INTEL/SPV_INTEL_joint_matrix/tf32_conversion_instructions.ll b/test/extensions/INTEL/SPV_INTEL_joint_matrix/tf32_conversion_instructions.ll index 04c96a33f9..6392c94138 100644 --- a/test/extensions/INTEL/SPV_INTEL_joint_matrix/tf32_conversion_instructions.ll +++ b/test/extensions/INTEL/SPV_INTEL_joint_matrix/tf32_conversion_instructions.ll @@ -6,6 +6,13 @@ ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc ; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM +; RUN: not llvm-spirv %t.bc --spirv-ext=+SPV_KHR_cooperative_matrix,+SPV_INTEL_tensor_float32_conversion 2>&1 \ +; RUN: | FileCheck %s --check-prefix=CHECK-ERROR + +; CHECK-ERROR: InvalidInstruction: Can't translate llvm instruction: +; CHECK-ERROR-NEXT: RoundFToTF32INTEL +; CHECK-ERROR-NEXT: Can be used with cooperative matrices only when SPV_INTEL_joint_matrix is enabled + ; CHECK-SPIRV-DAG: Capability CooperativeMatrixKHR ; CHECK-SPIRV-DAG: Capability TensorFloat32RoundingINTEL ; CHECK-SPIRV-DAG: Capability JointMatrixTF32ComponentTypeINTEL