Skip to content

Commit 66d53a4

Browse files
vmaksimoMrSidims
authored andcommitted
[Backport to 15] Remove internal values for SPV_INTEL_cache_controls
1 parent efad36d commit 66d53a4

File tree

5 files changed

+29
-56
lines changed

5 files changed

+29
-56
lines changed

lib/SPIRV/SPIRVWriter.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,7 +2632,7 @@ static void transMetadataDecorations(Metadata *MD, SPIRVValue *Target) {
26322632
break;
26332633
}
26342634

2635-
case spv::internal::DecorationCacheControlLoadINTEL: {
2635+
case DecorationCacheControlLoadINTEL: {
26362636
ErrLog.checkError(
26372637
NumOperands == 3, SPIRVEC_InvalidLlvmModule,
26382638
"CacheControlLoadINTEL requires exactly 2 extra operands");
@@ -2649,11 +2649,10 @@ static void transMetadataDecorations(Metadata *MD, SPIRVValue *Target) {
26492649

26502650
Target->addDecorate(new SPIRVDecorateCacheControlLoadINTEL(
26512651
Target, CacheLevel->getZExtValue(),
2652-
static_cast<internal::LoadCacheControlINTEL>(
2653-
CacheControl->getZExtValue())));
2652+
static_cast<LoadCacheControl>(CacheControl->getZExtValue())));
26542653
break;
26552654
}
2656-
case spv::internal::DecorationCacheControlStoreINTEL: {
2655+
case DecorationCacheControlStoreINTEL: {
26572656
ErrLog.checkError(
26582657
NumOperands == 3, SPIRVEC_InvalidLlvmModule,
26592658
"CacheControlStoreINTEL requires exactly 2 extra operands");
@@ -2670,8 +2669,7 @@ static void transMetadataDecorations(Metadata *MD, SPIRVValue *Target) {
26702669

26712670
Target->addDecorate(new SPIRVDecorateCacheControlStoreINTEL(
26722671
Target, CacheLevel->getZExtValue(),
2673-
static_cast<internal::StoreCacheControlINTEL>(
2674-
CacheControl->getZExtValue())));
2672+
static_cast<StoreCacheControl>(CacheControl->getZExtValue())));
26752673
break;
26762674
}
26772675
default: {

lib/SPIRV/libSPIRV/SPIRVDecorate.h

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ class SPIRVDecorate : public SPIRVDecorateGeneric {
189189

190190
case DecorationFPMaxErrorDecorationINTEL:
191191
return ExtensionID::SPV_INTEL_fp_max_error;
192-
case internal::DecorationCacheControlLoadINTEL:
193-
case internal::DecorationCacheControlStoreINTEL:
192+
case DecorationCacheControlLoadINTEL:
193+
case DecorationCacheControlStoreINTEL:
194194
return ExtensionID::SPV_INTEL_cache_controls;
195195
default:
196196
return {};
@@ -903,32 +903,31 @@ class SPIRVDecorateImplementInRegisterMapINTEL : public SPIRVDecorate {
903903
class SPIRVDecorateCacheControlLoadINTEL : public SPIRVDecorate {
904904
public:
905905
// Complete constructor for SPIRVDecorateCacheControlLoadINTEL
906-
SPIRVDecorateCacheControlLoadINTEL(
907-
SPIRVEntry *TheTarget, SPIRVWord CacheLevel,
908-
spv::internal::LoadCacheControlINTEL CacheControl)
909-
: SPIRVDecorate(spv::internal::DecorationCacheControlLoadINTEL, TheTarget,
910-
CacheLevel, static_cast<SPIRVWord>(CacheControl)){};
911-
912-
SPIRVWord getCacheLevel() const { return Literals.at(0); };
913-
spv::internal::LoadCacheControlINTEL getCacheControl() const {
914-
return static_cast<spv::internal::LoadCacheControlINTEL>(Literals.at(1));
915-
};
906+
SPIRVDecorateCacheControlLoadINTEL(SPIRVEntry *TheTarget,
907+
SPIRVWord CacheLevel,
908+
LoadCacheControl CacheControl)
909+
: SPIRVDecorate(DecorationCacheControlLoadINTEL, TheTarget, CacheLevel,
910+
static_cast<SPIRVWord>(CacheControl)) {}
911+
912+
SPIRVWord getCacheLevel() const { return Literals.at(0); }
913+
LoadCacheControl getCacheControl() const {
914+
return static_cast<LoadCacheControl>(Literals.at(1));
915+
}
916916
};
917917

918918
class SPIRVDecorateCacheControlStoreINTEL : public SPIRVDecorate {
919919
public:
920920
// Complete constructor for SPIRVDecorateCacheControlStoreINTEL
921-
SPIRVDecorateCacheControlStoreINTEL(
922-
SPIRVEntry *TheTarget, SPIRVWord CacheLevel,
923-
spv::internal::StoreCacheControlINTEL CacheControl)
924-
: SPIRVDecorate(spv::internal::DecorationCacheControlStoreINTEL,
925-
TheTarget, CacheLevel,
926-
static_cast<SPIRVWord>(CacheControl)){};
927-
928-
SPIRVWord getCacheLevel() const { return Literals.at(0); };
929-
spv::internal::StoreCacheControlINTEL getCacheControl() const {
930-
return static_cast<spv::internal::StoreCacheControlINTEL>(Literals.at(1));
931-
};
921+
SPIRVDecorateCacheControlStoreINTEL(SPIRVEntry *TheTarget,
922+
SPIRVWord CacheLevel,
923+
StoreCacheControl CacheControl)
924+
: SPIRVDecorate(DecorationCacheControlStoreINTEL, TheTarget, CacheLevel,
925+
static_cast<SPIRVWord>(CacheControl)) {}
926+
927+
SPIRVWord getCacheLevel() const { return Literals.at(0); }
928+
StoreCacheControl getCacheControl() const {
929+
return static_cast<StoreCacheControl>(Literals.at(1));
930+
}
932931
};
933932

934933
} // namespace SPIRV

lib/SPIRV/libSPIRV/SPIRVEnum.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,6 @@ template <> inline void SPIRVMap<Decoration, SPIRVCapVec>::init() {
476476
{CapabilityGlobalVariableFPGADecorationsINTEL});
477477
ADD_VEC_INIT(internal::DecorationArgumentAttributeINTEL,
478478
{CapabilityFunctionPointersINTEL});
479-
ADD_VEC_INIT(internal::DecorationCacheControlLoadINTEL,
480-
{internal::CapabilityCacheControlsINTEL});
481-
ADD_VEC_INIT(internal::DecorationCacheControlStoreINTEL,
482-
{internal::CapabilityCacheControlsINTEL});
483479
ADD_VEC_INIT(DecorationFPMaxErrorDecorationINTEL,
484480
{CapabilityFPMaxErrorINTEL});
485481
}

lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h

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

188+
add(DecorationCacheControlLoadINTEL, "CacheControlLoadINTEL");
189+
add(DecorationCacheControlStoreINTEL, "CacheControlStoreINTEL");
190+
188191
// From spirv_internal.hpp
189192
add(internal::DecorationMathOpDSPModeINTEL, "MathOpDSPModeINTEL");
190193
add(internal::DecorationInitiationIntervalINTEL, "InitiationIntervalINTEL");
@@ -195,8 +198,6 @@ template <> inline void SPIRVMap<Decoration, std::string>::init() {
195198
add(internal::DecorationInitModeINTEL, "InitModeINTEL");
196199
add(internal::DecorationImplementInCSRINTEL, "ImplementInCSRINTEL");
197200
add(internal::DecorationArgumentAttributeINTEL, "ArgumentAttributeINTEL");
198-
add(internal::DecorationCacheControlLoadINTEL, "CacheControlLoadINTEL");
199-
add(internal::DecorationCacheControlStoreINTEL, "CacheControlStoreINTEL");
200201

201202
add(DecorationMax, "Max");
202203
}

lib/SPIRV/libSPIRV/spirv_internal.hpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ enum InternalDecoration {
9797
IDecInitModeINTEL = 6148,
9898
IDecImplementInCSRINTEL = 6149,
9999
IDecArgumentAttributeINTEL = 6409,
100-
IDecCacheControlLoadINTEL = 6442,
101-
IDecCacheControlStoreINTEL = 6443
102100
};
103101

104102
enum InternalCapability {
@@ -141,21 +139,6 @@ enum InternalBuiltIn {
141139
IBuiltInGlobalHWThreadIDINTEL = 6136,
142140
};
143141

144-
enum class LoadCacheControlINTEL {
145-
Uncached = 0,
146-
Cached = 1,
147-
Streaming = 2,
148-
InvalidateAfterRead = 3,
149-
ConstCached = 4
150-
};
151-
152-
enum class StoreCacheControlINTEL {
153-
Uncached = 0,
154-
WriteThrough = 1,
155-
WriteBack = 2,
156-
Streaming = 3
157-
};
158-
159142
#define _SPIRV_OP(x, y) constexpr x x##y = static_cast<x>(I##x##y);
160143
_SPIRV_OP(Capability, JointMatrixINTEL)
161144
_SPIRV_OP(Capability, JointMatrixWIInstructionsINTEL)
@@ -262,10 +245,6 @@ constexpr Decoration DecorationImplementInCSRINTEL =
262245
static_cast<Decoration>(IDecImplementInCSRINTEL);
263246
constexpr Decoration DecorationArgumentAttributeINTEL =
264247
static_cast<Decoration>(IDecArgumentAttributeINTEL);
265-
constexpr Decoration DecorationCacheControlLoadINTEL =
266-
static_cast<Decoration>(IDecCacheControlLoadINTEL);
267-
constexpr Decoration DecorationCacheControlStoreINTEL =
268-
static_cast<Decoration>(IDecCacheControlStoreINTEL);
269248

270249
constexpr Capability CapabilityFPGADSPControlINTEL =
271250
static_cast<Capability>(ICapFPGADSPControlINTEL);

0 commit comments

Comments
 (0)