Skip to content

Commit ab5b6da

Browse files
committed
Revert "Add support for SPV_INTEL_fpga_buffer_location extension"
This reverts commit f71cec5.
1 parent 5c30093 commit ab5b6da

File tree

8 files changed

+0
-118
lines changed

8 files changed

+0
-118
lines changed

llvm-spirv/include/LLVMSPIRVExtensions.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ EXT(SPV_INTEL_optimization_hints)
2323
EXT(SPV_INTEL_float_controls2)
2424
EXT(SPV_INTEL_vector_compute)
2525
EXT(SPV_INTEL_usm_storage_classes)
26-
EXT(SPV_INTEL_fpga_buffer_location)

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -168,27 +168,6 @@ static void addOCLKernelArgumentMetadata(
168168
Fn->setMetadata(MDName, MDNode::get(*Context, ValueVec));
169169
}
170170

171-
static void addBufferLocationMetadata(
172-
LLVMContext *Context, SPIRVFunction *BF, llvm::Function *Fn,
173-
std::function<Metadata *(SPIRVFunctionParameter *)> Func) {
174-
std::vector<Metadata *> ValueVec;
175-
bool DecorationFound = false;
176-
BF->foreachArgument([&](SPIRVFunctionParameter *Arg) {
177-
if (Arg->getType()->isTypePointer() &&
178-
Arg->hasDecorate(DecorationBufferLocationINTEL)) {
179-
DecorationFound = true;
180-
ValueVec.push_back(Func(Arg));
181-
} else {
182-
llvm::Metadata *DefaultNode = ConstantAsMetadata::get(
183-
ConstantInt::get(Type::getInt32Ty(*Context), -1));
184-
ValueVec.push_back(DefaultNode);
185-
}
186-
});
187-
if (DecorationFound)
188-
Fn->setMetadata("kernel_arg_buffer_location",
189-
MDNode::get(*Context, ValueVec));
190-
}
191-
192171
Value *SPIRVToLLVM::getTranslatedValue(SPIRVValue *BV) {
193172
auto Loc = ValueMap.find(BV);
194173
if (Loc != ValueMap.end())
@@ -3540,15 +3519,6 @@ bool SPIRVToLLVM::transOCLMetadata(SPIRVFunction *BF) {
35403519
Arg->getName());
35413520
});
35423521
}
3543-
// Generate metadata for kernel_arg_buffer_location
3544-
addBufferLocationMetadata(Context, BF, F, [=](SPIRVFunctionParameter *Arg) {
3545-
auto Literals = Arg->getDecorationLiterals(DecorationBufferLocationINTEL);
3546-
assert(Literals.size() == 1 &&
3547-
"BufferLocationINTEL decoration shall have 1 ID literal");
3548-
3549-
return ConstantAsMetadata::get(
3550-
ConstantInt::get(Type::getInt32Ty(*Context), Literals[0]));
3551-
});
35523522
return true;
35533523
}
35543524

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -527,13 +527,6 @@ SPIRVFunction *LLVMToSPIRV::transFunctionDecl(Function *F) {
527527
BM->addEntryPoint(ExecutionModelKernel, BF->getId());
528528
else if (F->getLinkage() != GlobalValue::InternalLinkage)
529529
BF->setLinkageType(transLinkageType(F));
530-
531-
// Translate OpenCL/SYCL buffer_location metadata if it's attached to the
532-
// translated function declaration
533-
MDNode *BufferLocation = nullptr;
534-
if (BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_fpga_buffer_location))
535-
BufferLocation = ((*F).getMetadata("kernel_arg_buffer_location"));
536-
537530
auto Attrs = F->getAttributes();
538531

539532
for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E;
@@ -559,15 +552,6 @@ SPIRVFunction *LLVMToSPIRV::transFunctionDecl(Function *F) {
559552
BA->addDecorate(DecorationMaxByteOffset,
560553
Attrs.getAttribute(ArgNo + 1, Attribute::Dereferenceable)
561554
.getDereferenceableBytes());
562-
if (BufferLocation && I->getType()->isPointerTy()) {
563-
// Order of integer numbers in MD node follows the order of function
564-
// parameters on which we shall attach the appropriate decoration. Add
565-
// decoration only if MD value is not negative.
566-
BM->addCapability(CapabilityFPGABufferLocationINTEL);
567-
int LocID = getMDOperandAsInt(BufferLocation, ArgNo);
568-
if (LocID >= 0)
569-
BA->addDecorate(DecorationBufferLocationINTEL, LocID);
570-
}
571555
}
572556
if (Attrs.hasAttribute(AttributeList::ReturnIndex, Attribute::ZExt))
573557
BF->addDecorate(DecorationFuncParamAttr, FunctionParameterAttributeZext);

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ class SPIRVDecorate : public SPIRVDecorateGeneric {
164164
return getSet(ExtensionID::SPV_INTEL_function_pointers);
165165
case DecorationIOPipeStorageINTEL:
166166
return getSet(ExtensionID::SPV_INTEL_io_pipes);
167-
case DecorationBufferLocationINTEL:
168-
return getSet(ExtensionID::SPV_INTEL_fpga_buffer_location);
169167
default:
170168
return SPIRVExtSet();
171169
}
@@ -269,8 +267,6 @@ class SPIRVMemberDecorate : public SPIRVDecorateGeneric {
269267
return getSet(ExtensionID::SPV_INTEL_fpga_memory_accesses);
270268
case DecorationIOPipeStorageINTEL:
271269
return getSet(ExtensionID::SPV_INTEL_io_pipes);
272-
case DecorationBufferLocationINTEL:
273-
return getSet(ExtensionID::SPV_INTEL_fpga_buffer_location);
274270
default:
275271
return SPIRVExtSet();
276272
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,6 @@ template <> inline void SPIRVMap<Decoration, SPIRVCapVec>::init() {
402402
ADD_VEC_INIT(DecorationDontStaticallyCoalesceINTEL,
403403
{CapabilityFPGAMemoryAccessesINTEL});
404404
ADD_VEC_INIT(DecorationPrefetchINTEL, {CapabilityFPGAMemoryAccessesINTEL});
405-
ADD_VEC_INIT(DecorationBufferLocationINTEL,
406-
{CapabilityFPGABufferLocationINTEL});
407405
}
408406

409407
template <> inline void SPIRVMap<BuiltIn, SPIRVCapVec>::init() {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ template <> inline void SPIRVMap<Decoration, std::string>::init() {
376376
add(DecorationGlobalVariableOffsetINTEL, "GlobalVariableOffsetINTEL");
377377
add(DecorationFuncParamIOKind, "FuncParamIOKind");
378378
add(DecorationSIMTCallINTEL, "SIMTCallINTEL");
379-
add(DecorationBufferLocationINTEL, "BufferLocationINTEL");
380379
}
381380
SPIRV_DEF_NAMEMAP(Decoration, SPIRVDecorationNameMap)
382381

@@ -561,7 +560,6 @@ template <> inline void SPIRVMap<Capability, std::string>::init() {
561560
"GroupNonUniformShuffleRelative");
562561
add(CapabilityGroupNonUniformClustered, "GroupNonUniformClustered");
563562
add(CapabilityUSMStorageClassesINTEL, "USMStorageClassesINTEL");
564-
add(CapabilityFPGABufferLocationINTEL, "FPGABufferLocationINTEL");
565563
}
566564
SPIRV_DEF_NAMEMAP(Capability, SPIRVCapabilityNameMap)
567565

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,6 @@ enum Decoration {
508508
DecorationCacheSizeINTEL = 5900,
509509
DecorationDontStaticallyCoalesceINTEL = 5901,
510510
DecorationPrefetchINTEL = 5902,
511-
DecorationBufferLocationINTEL = 5921,
512511
DecorationIOPipeStorageINTEL = 5944,
513512
DecorationMax = 0x7fffffff,
514513
};
@@ -963,7 +962,6 @@ enum Capability {
963962
CapabilityFPGARegINTEL = 5948,
964963
CapabilityKernelAttributesINTEL = 5892,
965964
CapabilityFPGAKernelAttributesINTEL = 5897,
966-
CapabilityFPGABufferLocationINTEL = 5920,
967965
CapabilityUSMStorageClassesINTEL = 5935,
968966
CapabilityFPGAMemoryAccessesINTEL = 5898,
969967
CapabilityIOPipeINTEL = 5943,

llvm-spirv/test/transcoding/FPGABufferLocation.ll

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)