@@ -1451,9 +1451,11 @@ void addInstrRequirements(const MachineInstr &MI,
14511451 const int64_t CoopOperands = MI.getOperand (MulAddMaxSize - 1 ).getImm ();
14521452 if (CoopOperands &
14531453 SPIRV::CooperativeMatrixOperands::MatrixAAndBTF32ComponentsINTEL) {
1454- report_fatal_error (" MatrixAAndBTF32ComponentsINTEL type interpretation "
1455- " require the following SPIR-V extension: "
1456- " SPV_INTEL_joint_matrix" , false );
1454+ if (!ST.canUseExtension (SPIRV::Extension::SPV_INTEL_joint_matrix))
1455+ report_fatal_error (" MatrixAAndBTF32ComponentsINTEL type interpretation "
1456+ " require the following SPIR-V extension: "
1457+ " SPV_INTEL_joint_matrix" ,
1458+ false );
14571459 Reqs.addExtension (SPIRV::Extension::SPV_INTEL_joint_matrix);
14581460 Reqs.addCapability (
14591461 SPIRV::Capability::CooperativeMatrixTF32ComponentTypeINTEL);
@@ -1464,9 +1466,11 @@ void addInstrRequirements(const MachineInstr &MI,
14641466 SPIRV::CooperativeMatrixOperands::MatrixCBFloat16ComponentsINTEL ||
14651467 CoopOperands & SPIRV::CooperativeMatrixOperands::
14661468 MatrixResultBFloat16ComponentsINTEL) {
1467- report_fatal_error (" ***BF16ComponentsINTEL type interpretations require "
1468- " the following SPIR-V extension: "
1469- " SPV_INTEL_joint_matrix" , false );
1469+ if (!ST.canUseExtension (SPIRV::Extension::SPV_INTEL_joint_matrix))
1470+ report_fatal_error (" ***BF16ComponentsINTEL type interpretations "
1471+ " require the following SPIR-V extension: "
1472+ " SPV_INTEL_joint_matrix" ,
1473+ false );
14701474 Reqs.addExtension (SPIRV::Extension::SPV_INTEL_joint_matrix);
14711475 Reqs.addCapability (
14721476 SPIRV::Capability::CooperativeMatrixBFloat16ComponentTypeINTEL);
@@ -1519,21 +1523,22 @@ void addInstrRequirements(const MachineInstr &MI,
15191523 break ;
15201524
15211525 std::string InstName;
1522- switch (OpCode) {
1523- case SPIRV::OpCooperativeMatrixPrefetchINTEL:
1524- InstName = " OpCooperativeMatrixPrefetchINTEL" ;
1525- break ;
1526- case SPIRV::OpCooperativeMatrixLoadCheckedINTEL:
1527- InstName = " OpCooperativeMatrixLoadCheckedINTEL" ;
1528- break ;
1529- case SPIRV::OpCooperativeMatrixStoreCheckedINTEL:
1530- InstName = " OpCooperativeMatrixStoreCheckedINTEL" ;
1531- break ;
1526+ switch (OpCode) {
1527+ case SPIRV::OpCooperativeMatrixPrefetchINTEL:
1528+ InstName = " OpCooperativeMatrixPrefetchINTEL" ;
1529+ break ;
1530+ case SPIRV::OpCooperativeMatrixLoadCheckedINTEL:
1531+ InstName = " OpCooperativeMatrixLoadCheckedINTEL" ;
1532+ break ;
1533+ case SPIRV::OpCooperativeMatrixStoreCheckedINTEL:
1534+ InstName = " OpCooperativeMatrixStoreCheckedINTEL" ;
1535+ break ;
15321536 }
15331537
15341538 if (!ST.canUseExtension (SPIRV::Extension::SPV_INTEL_joint_matrix)) {
1535- const std::string ErrorMsg = InstName + " instruction requires the "
1536- " following SPIR-V extension: SPV_INTEL_joint_matrix" ;
1539+ const std::string ErrorMsg =
1540+ InstName + " instruction requires the "
1541+ " following SPIR-V extension: SPV_INTEL_joint_matrix" ;
15371542 report_fatal_error (ErrorMsg.c_str (), false );
15381543 }
15391544 Reqs.addExtension (SPIRV::Extension::SPV_INTEL_joint_matrix);
0 commit comments