Skip to content

Commit 6695b8a

Browse files
vmaksimosys-ce-bb
authored andcommitted
Remove internal values for SPV_INTEL_cache_controls (#2346)
The Headers for this extension were published so we should use them instead: KhronosGroup/SPIRV-Headers@a8af2ce Original commit: KhronosGroup/SPIRV-LLVM-Translator@95d70a9ab4077ed
1 parent a617aad commit 6695b8a

File tree

5 files changed

+34
-60
lines changed

5 files changed

+34
-60
lines changed

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2874,7 +2874,7 @@ static void transMetadataDecorations(Metadata *MD, SPIRVEntry *Target) {
28742874
break;
28752875
}
28762876

2877-
case spv::internal::DecorationCacheControlLoadINTEL: {
2877+
case DecorationCacheControlLoadINTEL: {
28782878
ErrLog.checkError(
28792879
NumOperands == 3, SPIRVEC_InvalidLlvmModule,
28802880
"CacheControlLoadINTEL requires exactly 2 extra operands");
@@ -2891,11 +2891,10 @@ static void transMetadataDecorations(Metadata *MD, SPIRVEntry *Target) {
28912891

28922892
Target->addDecorate(new SPIRVDecorateCacheControlLoadINTEL(
28932893
Target, CacheLevel->getZExtValue(),
2894-
static_cast<internal::LoadCacheControlINTEL>(
2895-
CacheControl->getZExtValue())));
2894+
static_cast<LoadCacheControl>(CacheControl->getZExtValue())));
28962895
break;
28972896
}
2898-
case spv::internal::DecorationCacheControlStoreINTEL: {
2897+
case DecorationCacheControlStoreINTEL: {
28992898
ErrLog.checkError(
29002899
NumOperands == 3, SPIRVEC_InvalidLlvmModule,
29012900
"CacheControlStoreINTEL requires exactly 2 extra operands");
@@ -2912,8 +2911,7 @@ static void transMetadataDecorations(Metadata *MD, SPIRVEntry *Target) {
29122911

29132912
Target->addDecorate(new SPIRVDecorateCacheControlStoreINTEL(
29142913
Target, CacheLevel->getZExtValue(),
2915-
static_cast<internal::StoreCacheControlINTEL>(
2916-
CacheControl->getZExtValue())));
2914+
static_cast<StoreCacheControl>(CacheControl->getZExtValue())));
29172915
break;
29182916
}
29192917
default: {
@@ -3369,8 +3367,7 @@ AnnotationDecorations tryParseAnnotationString(SPIRVModule *BM,
33693367
Decorates.LatencyControlVec.emplace_back(
33703368
static_cast<Decoration>(DecorationKind), std::move(DecValues));
33713369
} else if (AllowCacheControls &&
3372-
DecorationKind ==
3373-
internal::DecorationCacheControlLoadINTEL) {
3370+
DecorationKind == DecorationCacheControlLoadINTEL) {
33743371
Decorates.CacheControlVec.emplace_back(
33753372
static_cast<Decoration>(DecorationKind), std::move(DecValues));
33763373
} else if (DecorationKind == DecorationMemoryINTEL) {
@@ -3631,7 +3628,7 @@ void addAnnotationDecorations(SPIRVEntry *E, DecorationsInfoVec &Decorations) {
36313628
}
36323629
break;
36333630
}
3634-
case spv::internal::DecorationCacheControlLoadINTEL: {
3631+
case DecorationCacheControlLoadINTEL: {
36353632
if (M->isAllowedToUseExtension(ExtensionID::SPV_INTEL_cache_controls)) {
36363633
M->getErrorLog().checkError(
36373634
I.second.size() == 2, SPIRVEC_InvalidLlvmModule,
@@ -3641,8 +3638,7 @@ void addAnnotationDecorations(SPIRVEntry *E, DecorationsInfoVec &Decorations) {
36413638
StringRef(I.second[0]).getAsInteger(10, CacheLevel);
36423639
StringRef(I.second[1]).getAsInteger(10, CacheControl);
36433640
E->addDecorate(new SPIRVDecorateCacheControlLoadINTEL(
3644-
E, CacheLevel,
3645-
static_cast<internal::LoadCacheControlINTEL>(CacheControl)));
3641+
E, CacheLevel, static_cast<LoadCacheControl>(CacheControl)));
36463642
}
36473643
}
36483644

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVDecorate.h

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ class SPIRVDecorate : public SPIRVDecorateGeneric {
214214
return ExtensionID::SPV_INTEL_fpga_latency_control;
215215
case DecorationFPMaxErrorDecorationINTEL:
216216
return ExtensionID::SPV_INTEL_fp_max_error;
217-
case internal::DecorationCacheControlLoadINTEL:
218-
case internal::DecorationCacheControlStoreINTEL:
217+
case DecorationCacheControlLoadINTEL:
218+
case DecorationCacheControlStoreINTEL:
219219
return ExtensionID::SPV_INTEL_cache_controls;
220220
default:
221221
return {};
@@ -941,32 +941,31 @@ class SPIRVDecorateImplementInRegisterMapINTEL : public SPIRVDecorate {
941941
class SPIRVDecorateCacheControlLoadINTEL : public SPIRVDecorate {
942942
public:
943943
// Complete constructor for SPIRVDecorateCacheControlLoadINTEL
944-
SPIRVDecorateCacheControlLoadINTEL(
945-
SPIRVEntry *TheTarget, SPIRVWord CacheLevel,
946-
spv::internal::LoadCacheControlINTEL CacheControl)
947-
: SPIRVDecorate(spv::internal::DecorationCacheControlLoadINTEL, TheTarget,
948-
CacheLevel, static_cast<SPIRVWord>(CacheControl)){};
944+
SPIRVDecorateCacheControlLoadINTEL(SPIRVEntry *TheTarget,
945+
SPIRVWord CacheLevel,
946+
LoadCacheControl CacheControl)
947+
: SPIRVDecorate(DecorationCacheControlLoadINTEL, TheTarget, CacheLevel,
948+
static_cast<SPIRVWord>(CacheControl)) {}
949949

950-
SPIRVWord getCacheLevel() const { return Literals.at(0); };
951-
spv::internal::LoadCacheControlINTEL getCacheControl() const {
952-
return static_cast<spv::internal::LoadCacheControlINTEL>(Literals.at(1));
953-
};
950+
SPIRVWord getCacheLevel() const { return Literals.at(0); }
951+
LoadCacheControl getCacheControl() const {
952+
return static_cast<LoadCacheControl>(Literals.at(1));
953+
}
954954
};
955955

956956
class SPIRVDecorateCacheControlStoreINTEL : public SPIRVDecorate {
957957
public:
958958
// Complete constructor for SPIRVDecorateCacheControlStoreINTEL
959-
SPIRVDecorateCacheControlStoreINTEL(
960-
SPIRVEntry *TheTarget, SPIRVWord CacheLevel,
961-
spv::internal::StoreCacheControlINTEL CacheControl)
962-
: SPIRVDecorate(spv::internal::DecorationCacheControlStoreINTEL,
963-
TheTarget, CacheLevel,
964-
static_cast<SPIRVWord>(CacheControl)){};
965-
966-
SPIRVWord getCacheLevel() const { return Literals.at(0); };
967-
spv::internal::StoreCacheControlINTEL getCacheControl() const {
968-
return static_cast<spv::internal::StoreCacheControlINTEL>(Literals.at(1));
969-
};
959+
SPIRVDecorateCacheControlStoreINTEL(SPIRVEntry *TheTarget,
960+
SPIRVWord CacheLevel,
961+
StoreCacheControl CacheControl)
962+
: SPIRVDecorate(DecorationCacheControlStoreINTEL, TheTarget, CacheLevel,
963+
static_cast<SPIRVWord>(CacheControl)) {}
964+
965+
SPIRVWord getCacheLevel() const { return Literals.at(0); }
966+
StoreCacheControl getCacheControl() const {
967+
return static_cast<StoreCacheControl>(Literals.at(1));
968+
}
970969
};
971970

972971
} // namespace SPIRV

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVEnum.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,10 +496,9 @@ template <> inline void SPIRVMap<Decoration, SPIRVCapVec>::init() {
496496
{CapabilityGlobalVariableFPGADecorationsINTEL});
497497
ADD_VEC_INIT(internal::DecorationArgumentAttributeINTEL,
498498
{CapabilityFunctionPointersINTEL});
499-
ADD_VEC_INIT(internal::DecorationCacheControlLoadINTEL,
500-
{internal::CapabilityCacheControlsINTEL});
501-
ADD_VEC_INIT(internal::DecorationCacheControlStoreINTEL,
502-
{internal::CapabilityCacheControlsINTEL});
499+
ADD_VEC_INIT(DecorationCacheControlLoadINTEL, {CapabilityCacheControlsINTEL});
500+
ADD_VEC_INIT(DecorationCacheControlStoreINTEL,
501+
{CapabilityCacheControlsINTEL});
503502
ADD_VEC_INIT(DecorationConduitKernelArgumentINTEL,
504503
{CapabilityFPGAArgumentInterfacesINTEL});
505504
ADD_VEC_INIT(DecorationRegisterMapKernelArgumentINTEL,

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ template <> inline void SPIRVMap<Decoration, std::string>::init() {
221221
add(DecorationInitModeINTEL, "InitModeINTEL");
222222
add(DecorationImplementInRegisterMapINTEL, "ImplementInRegisterMapINTEL");
223223

224+
add(DecorationCacheControlLoadINTEL, "CacheControlLoadINTEL");
225+
add(DecorationCacheControlStoreINTEL, "CacheControlStoreINTEL");
226+
224227
// From spirv_internal.hpp
225228
add(internal::DecorationFuncParamKindINTEL, "FuncParamKindINTEL");
226229
add(internal::DecorationFuncParamDescINTEL, "FuncParamDescINTEL");
@@ -230,8 +233,6 @@ template <> inline void SPIRVMap<Decoration, std::string>::init() {
230233
add(internal::DecorationInitModeINTEL, "InitModeINTEL");
231234
add(internal::DecorationImplementInCSRINTEL, "ImplementInCSRINTEL");
232235
add(internal::DecorationArgumentAttributeINTEL, "ArgumentAttributeINTEL");
233-
add(internal::DecorationCacheControlLoadINTEL, "CacheControlLoadINTEL");
234-
add(internal::DecorationCacheControlStoreINTEL, "CacheControlStoreINTEL");
235236

236237
add(DecorationMax, "Max");
237238
}

llvm-spirv/lib/SPIRV/libSPIRV/spirv_internal.hpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ enum InternalDecoration {
9898
IDecInitModeINTEL = 6148,
9999
IDecImplementInCSRINTEL = 6149,
100100
IDecArgumentAttributeINTEL = 6409,
101-
IDecCacheControlLoadINTEL = 6442,
102-
IDecCacheControlStoreINTEL = 6443,
103101
IDecFuncParamKindINTEL = 9624,
104102
IDecFuncParamDescINTEL = 9625
105103
};
@@ -161,21 +159,6 @@ enum InternalBuiltIn {
161159
IBuiltInGlobalHWThreadIDINTEL = 6136,
162160
};
163161

164-
enum class LoadCacheControlINTEL {
165-
Uncached = 0,
166-
Cached = 1,
167-
Streaming = 2,
168-
InvalidateAfterRead = 3,
169-
ConstCached = 4
170-
};
171-
172-
enum class StoreCacheControlINTEL {
173-
Uncached = 0,
174-
WriteThrough = 1,
175-
WriteBack = 2,
176-
Streaming = 3
177-
};
178-
179162
#define _SPIRV_OP(x, y) constexpr x x##y = static_cast<x>(I##x##y);
180163
_SPIRV_OP(Capability, JointMatrixINTEL)
181164
_SPIRV_OP(Capability, JointMatrixWIInstructionsINTEL)
@@ -296,10 +279,6 @@ constexpr Decoration DecorationFuncParamKindINTEL =
296279
static_cast<Decoration>(IDecFuncParamKindINTEL);
297280
constexpr Decoration DecorationFuncParamDescINTEL =
298281
static_cast<Decoration>(IDecFuncParamDescINTEL);
299-
constexpr Decoration DecorationCacheControlLoadINTEL =
300-
static_cast<Decoration>(IDecCacheControlLoadINTEL);
301-
constexpr Decoration DecorationCacheControlStoreINTEL =
302-
static_cast<Decoration>(IDecCacheControlStoreINTEL);
303282

304283
constexpr Capability CapabilityFastCompositeINTEL =
305284
static_cast<Capability>(ICapFastCompositeINTEL);

0 commit comments

Comments
 (0)