From a41546ad3cdc1141ac1db29a9e3e2793fbec2306 Mon Sep 17 00:00:00 2001 From: Vadim Semenov Date: Tue, 10 Jun 2025 15:52:53 -0700 Subject: [PATCH] Remove SPV_INTEL_fast_composite extension (#3183) --- include/LLVMSPIRVExtensions.inc | 2 +- lib/SPIRV/PreprocessMetadata.cpp | 6 --- lib/SPIRV/SPIRVReader.cpp | 6 --- lib/SPIRV/SPIRVWriter.cpp | 10 ----- lib/SPIRV/libSPIRV/SPIRVDecorate.h | 2 - lib/SPIRV/libSPIRV/SPIRVEntry.h | 2 - lib/SPIRV/libSPIRV/SPIRVEnum.h | 4 -- lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h | 2 - lib/SPIRV/libSPIRV/spirv_internal.hpp | 9 ----- .../callable-attribute-decoration.ll | 19 --------- .../fast-composit-entry.ll | 40 ------------------- 11 files changed, 1 insertion(+), 101 deletions(-) delete mode 100644 test/extensions/INTEL/SPV_INTEL_fast_composite/callable-attribute-decoration.ll delete mode 100644 test/extensions/INTEL/SPV_INTEL_fast_composite/fast-composit-entry.ll diff --git a/include/LLVMSPIRVExtensions.inc b/include/LLVMSPIRVExtensions.inc index 2880ada170..a8f3734a8f 100644 --- a/include/LLVMSPIRVExtensions.inc +++ b/include/LLVMSPIRVExtensions.inc @@ -34,7 +34,7 @@ EXT(SPV_INTEL_arbitrary_precision_integers) EXT(SPV_INTEL_optimization_hints) EXT(SPV_INTEL_float_controls2) EXT(SPV_INTEL_vector_compute) -EXT(SPV_INTEL_fast_composite) +EXT(SPV_INTEL_fast_composite) // TODO: to remove EXT(SPV_INTEL_usm_storage_classes) EXT(SPV_INTEL_fpga_buffer_location) EXT(SPV_INTEL_arbitrary_precision_fixed_point) diff --git a/lib/SPIRV/PreprocessMetadata.cpp b/lib/SPIRV/PreprocessMetadata.cpp index 15fb410cbc..6384275214 100644 --- a/lib/SPIRV/PreprocessMetadata.cpp +++ b/lib/SPIRV/PreprocessMetadata.cpp @@ -380,12 +380,6 @@ void PreprocessMetadataBase::preprocessVectorComputeMetadata(Module *M, .add(SLMSize) .done(); } - if (Attrs.hasFnAttr(kVCMetadata::VCFCEntry)) { - EM.addOp() - .add(&F) - .add(spv::internal::ExecutionModeFastCompositeKernelINTEL) - .done(); - } if (Attrs.hasFnAttr(kVCMetadata::VCNamedBarrierCount)) { SPIRVWord NBarrierCnt = 0; diff --git a/lib/SPIRV/SPIRVReader.cpp b/lib/SPIRV/SPIRVReader.cpp index b411b6c01d..1d0604b81a 100644 --- a/lib/SPIRV/SPIRVReader.cpp +++ b/lib/SPIRV/SPIRVReader.cpp @@ -4465,12 +4465,6 @@ bool SPIRVToLLVM::transMetadata() { if (BM->getDesiredBIsRepresentation() == BIsRepresentation::SPIRVFriendlyIR) transFunctionDecorationsToMetadata(BF, F); - if (BF->hasDecorate(internal::DecorationCallableFunctionINTEL)) - F->addFnAttr(kVCMetadata::VCCallable); - if (isKernel(BF) && - BF->getExecutionMode(internal::ExecutionModeFastCompositeKernelINTEL)) - F->addFnAttr(kVCMetadata::VCFCEntry); - if (F->getCallingConv() != CallingConv::SPIR_KERNEL) continue; diff --git a/lib/SPIRV/SPIRVWriter.cpp b/lib/SPIRV/SPIRVWriter.cpp index 0bc0291616..5a81bc6578 100644 --- a/lib/SPIRV/SPIRVWriter.cpp +++ b/lib/SPIRV/SPIRVWriter.cpp @@ -993,11 +993,6 @@ SPIRVFunction *LLVMToSPIRVBase::transFunctionDecl(Function *F) { BF->addDecorate(DecorationReferencedIndirectlyINTEL); } - if (Attrs.hasFnAttr(kVCMetadata::VCCallable) && - BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_fast_composite)) { - BF->addDecorate(internal::DecorationCallableFunctionINTEL); - } - if (BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_vector_compute)) transVectorComputeMetadata(F); @@ -6083,11 +6078,6 @@ bool LLVMToSPIRVBase::transExecutionMode() { break; AddSingleArgExecutionMode(static_cast(EMode)); } break; - case spv::internal::ExecutionModeFastCompositeKernelINTEL: { - if (BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_fast_composite)) - BF->addExecutionMode(BM->add(new SPIRVExecutionMode( - OpExecutionMode, BF, static_cast(EMode)))); - } break; case spv::internal::ExecutionModeNamedSubgroupSizeINTEL: { if (!BM->isAllowedToUseExtension( ExtensionID::SPV_INTEL_subgroup_requirements)) diff --git a/lib/SPIRV/libSPIRV/SPIRVDecorate.h b/lib/SPIRV/libSPIRV/SPIRVDecorate.h index c93800c276..40abdcee54 100644 --- a/lib/SPIRV/libSPIRV/SPIRVDecorate.h +++ b/lib/SPIRV/libSPIRV/SPIRVDecorate.h @@ -182,8 +182,6 @@ class SPIRVDecorate : public SPIRVDecorateGeneric { return ExtensionID::SPV_INTEL_fpga_cluster_attributes; case DecorationFuseLoopsInFunctionINTEL: return ExtensionID::SPV_INTEL_loop_fuse; - case internal::DecorationCallableFunctionINTEL: - return ExtensionID::SPV_INTEL_fast_composite; case DecorationMathOpDSPModeINTEL: return ExtensionID::SPV_INTEL_fpga_dsp_control; case DecorationInitiationIntervalINTEL: diff --git a/lib/SPIRV/libSPIRV/SPIRVEntry.h b/lib/SPIRV/libSPIRV/SPIRVEntry.h index acc59ed179..6f41132428 100644 --- a/lib/SPIRV/libSPIRV/SPIRVEntry.h +++ b/lib/SPIRV/libSPIRV/SPIRVEntry.h @@ -907,8 +907,6 @@ class SPIRVCapability : public SPIRVEntryNoId { case CapabilityVectorComputeINTEL: case CapabilityVectorAnyINTEL: return ExtensionID::SPV_INTEL_vector_compute; - case internal::CapabilityFastCompositeINTEL: - return ExtensionID::SPV_INTEL_fast_composite; case internal::CapabilitySubgroupRequirementsINTEL: return ExtensionID::SPV_INTEL_subgroup_requirements; case CapabilityFPFastMathModeINTEL: diff --git a/lib/SPIRV/libSPIRV/SPIRVEnum.h b/lib/SPIRV/libSPIRV/SPIRVEnum.h index 462753288a..579a7ec47f 100644 --- a/lib/SPIRV/libSPIRV/SPIRVEnum.h +++ b/lib/SPIRV/libSPIRV/SPIRVEnum.h @@ -286,8 +286,6 @@ template <> inline void SPIRVMap::init() { {CapabilityFloatingPointModeINTEL}); ADD_VEC_INIT(ExecutionModeSharedLocalMemorySizeINTEL, {CapabilityVectorComputeINTEL}); - ADD_VEC_INIT(internal::ExecutionModeFastCompositeKernelINTEL, - {internal::CapabilityFastCompositeINTEL}); ADD_VEC_INIT(ExecutionModeRegisterMapInterfaceINTEL, {CapabilityFPGAKernelAttributesv2INTEL}); ADD_VEC_INIT(ExecutionModeStreamingInterfaceINTEL, @@ -469,8 +467,6 @@ template <> inline void SPIRVMap::init() { ADD_VEC_INIT(DecorationAliasScopeINTEL, {CapabilityMemoryAccessAliasingINTEL}); ADD_VEC_INIT(DecorationNoAliasINTEL, {CapabilityMemoryAccessAliasingINTEL}); - ADD_VEC_INIT(internal::DecorationCallableFunctionINTEL, - {internal::CapabilityFastCompositeINTEL}); ADD_VEC_INIT(DecorationMediaBlockIOINTEL, {CapabilityVectorComputeINTEL}); ADD_VEC_INIT(DecorationStallEnableINTEL, {CapabilityFPGAClusterAttributesINTEL}); diff --git a/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h b/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h index 5abe3e9699..896dcefb66 100644 --- a/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h +++ b/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h @@ -212,7 +212,6 @@ template <> inline void SPIRVMap::init() { add(DecorationCacheControlStoreINTEL, "CacheControlStoreINTEL"); // From spirv_internal.hpp - add(internal::DecorationCallableFunctionINTEL, "CallableFunctionINTEL"); add(internal::DecorationRuntimeAlignedINTEL, "RuntimeAlignedINTEL"); add(internal::DecorationHostAccessINTEL, "HostAccessINTEL"); add(internal::DecorationInitModeINTEL, "InitModeINTEL"); @@ -651,7 +650,6 @@ template <> inline void SPIRVMap::init() { "SubgroupMatrixMultiplyAccumulateINTEL"); add(CapabilityTernaryBitwiseFunctionINTEL, "TernaryBitwiseFunctionINTEL"); // From spirv_internal.hpp - add(internal::CapabilityFastCompositeINTEL, "FastCompositeINTEL"); add(internal::CapabilityTokenTypeINTEL, "TokenTypeINTEL"); add(internal::CapabilityBfloat16ConversionINTEL, "Bfloat16ConversionINTEL"); add(internal::CapabilityJointMatrixINTEL, "JointMatrixINTEL"); diff --git a/lib/SPIRV/libSPIRV/spirv_internal.hpp b/lib/SPIRV/libSPIRV/spirv_internal.hpp index 711eab8f18..838bc316ba 100644 --- a/lib/SPIRV/libSPIRV/spirv_internal.hpp +++ b/lib/SPIRV/libSPIRV/spirv_internal.hpp @@ -103,7 +103,6 @@ enum InternalDecoration { }; enum InternalCapability { - ICapFastCompositeINTEL = 6093, ICapTokenTypeINTEL = 6112, ICapBfloat16ConversionINTEL = 6115, ICapabilityJointMatrixINTEL = 6118, @@ -126,7 +125,6 @@ enum InternalCapability { }; enum InternalExecutionMode { - IExecModeFastCompositeKernelINTEL = 6088, IExecModeNamedSubgroupSizeINTEL = 6446, }; @@ -260,8 +258,6 @@ constexpr Op OpTypeTokenINTEL = static_cast(IOpTypeTokenINTEL); constexpr Op OpConvertFToBF16INTEL = static_cast(IOpConvertFToBF16INTEL); constexpr Op OpConvertBF16ToFINTEL = static_cast(IOpConvertBF16ToFINTEL); -constexpr Decoration DecorationCallableFunctionINTEL = - static_cast(IDecCallableFunctionINTEL); constexpr Decoration DecorationRuntimeAlignedINTEL = static_cast(IDecRuntimeAlignedINTEL); constexpr Decoration DecorationHostAccessINTEL = @@ -273,8 +269,6 @@ constexpr Decoration DecorationImplementInCSRINTEL = constexpr Decoration DecorationArgumentAttributeINTEL = static_cast(IDecArgumentAttributeINTEL); -constexpr Capability CapabilityFastCompositeINTEL = - static_cast(ICapFastCompositeINTEL); constexpr Capability CapabilityTokenTypeINTEL = static_cast(ICapTokenTypeINTEL); constexpr Capability CapabilityBfloat16ConversionINTEL = @@ -282,9 +276,6 @@ constexpr Capability CapabilityBfloat16ConversionINTEL = constexpr Capability CapabilityGlobalVariableDecorationsINTEL = static_cast(ICapGlobalVariableDecorationsINTEL); -constexpr ExecutionMode ExecutionModeFastCompositeKernelINTEL = - static_cast(IExecModeFastCompositeKernelINTEL); - constexpr ExecutionMode ExecutionModeNamedSubgroupSizeINTEL = static_cast(IExecModeNamedSubgroupSizeINTEL); diff --git a/test/extensions/INTEL/SPV_INTEL_fast_composite/callable-attribute-decoration.ll b/test/extensions/INTEL/SPV_INTEL_fast_composite/callable-attribute-decoration.ll deleted file mode 100644 index 3dc36681c2..0000000000 --- a/test/extensions/INTEL/SPV_INTEL_fast_composite/callable-attribute-decoration.ll +++ /dev/null @@ -1,19 +0,0 @@ -; RUN: llvm-as %s -o %t.bc -; RUN: llvm-spirv %t.bc -o %t.spv --spirv-ext=+SPV_INTEL_fast_composite -; RUN: llvm-spirv %t.spv -o %t.spt --to-text -; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV -; RUN: llvm-spirv %t.spv -o %t.bc -r -; RUN: llvm-dis %t.bc -o %t.ll -; RUN: FileCheck < %t.ll %s --check-prefix=CHECK-LLVM -target triple = "spir64" - - -define dso_local <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b) #0 { -entry: - ret <4 x i32> %a -} -; CHECK-SPIRV: 3 Decorate {{[0-9]+}} CallableFunctionINTEL -; CHECK-LLVM: attributes -; CHECK-LLVM-SAME: "VCCallable" - -attributes #0 = { "VCCallable" "VCFunction" } diff --git a/test/extensions/INTEL/SPV_INTEL_fast_composite/fast-composit-entry.ll b/test/extensions/INTEL/SPV_INTEL_fast_composite/fast-composit-entry.ll deleted file mode 100644 index 150dc1d45e..0000000000 --- a/test/extensions/INTEL/SPV_INTEL_fast_composite/fast-composit-entry.ll +++ /dev/null @@ -1,40 +0,0 @@ -; RUN: llvm-as %s -o %t.bc -; RUN: llvm-spirv %t.bc -o %t.spv --spirv-ext=+SPV_INTEL_fast_composite -; RUN: llvm-spirv %t.spv -o %t.spt --to-text -; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV -; RUN: llvm-spirv %t.spv -o %t.bc -r -; RUN: llvm-dis %t.bc -o %t.ll -; RUN: FileCheck < %t.ll %s --check-prefix=CHECK-LLVM - -target triple = "spir64-unknown-unknown" - - -; CHECK-SPIRV: {{[0-9]+}} EntryPoint {{[0-9]+}} [[#FOO_ID:]] "foo" -; CHECK-SPIRV: {{[0-9]+}} EntryPoint {{[0-9]+}} [[#BAR_ID:]] "bar" -; CHECK-SPIRV: 3 ExecutionMode [[#FOO_ID]] 6088 -; CHECK-SPIRV-NOT: 3 ExecutionMode [[#BAR_ID]] 6088 - -; CHECK-LLVM: define spir_kernel void @foo -; CHECK-LLVM-SAME: #[[#FOO_ATTR_ID:]] -; CHECK-LLVM: define spir_kernel void @bar -; CHECK-LLVM-SAME: #[[#BAR_ATTR_ID:]] - -; CHECK-LLVM: attributes #[[#FOO_ATTR_ID]] -; CHECK-LLVM-SAME: "VCFCEntry" -; CHECK-LLVM: attributes #[[#BAR_ATTR_ID]] -; CHECK-LLVM-NOT: "VCFCEntry" - - -define spir_kernel void @foo(<4 x i32> %a, <4 x i32> %b) #0 { -entry: - ret void -} - -define spir_kernel void @bar(<4 x i32> %a, <4 x i32> %b) #1 { -entry: - ret void -} - -attributes #0 = { noinline nounwind "VCFCEntry" "VCFloatControl"="0" "VCFunction" } -attributes #1 = { noinline nounwind "VCFloatControl"="48" "VCFunction" } -