Skip to content

Commit 88cbe10

Browse files
authored
[SPIR-V] Add CapabilityFPGABufferLocationINTEL only when the decoration is added (#2240)
Signed-off-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
1 parent 3530b73 commit 88cbe10

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,11 @@ SPIRVFunction *LLVMToSPIRV::transFunctionDecl(Function *F) {
563563
// Order of integer numbers in MD node follows the order of function
564564
// parameters on which we shall attach the appropriate decoration. Add
565565
// decoration only if MD value is not negative.
566-
BM->addCapability(CapabilityFPGABufferLocationINTEL);
567566
int LocID = getMDOperandAsInt(BufferLocation, ArgNo);
568-
if (LocID >= 0)
567+
if (LocID >= 0) {
568+
BM->addCapability(CapabilityFPGABufferLocationINTEL);
569569
BA->addDecorate(DecorationBufferLocationINTEL, LocID);
570+
}
570571
}
571572
}
572573
if (Attrs.hasAttribute(AttributeList::ReturnIndex, Attribute::ZExt))

0 commit comments

Comments
 (0)