Skip to content

Commit 49b08e8

Browse files
authored
Add SPV_INTEL_masked_gather_scatter extension (#1580)
This extension allows TypeVector to have a Physical Pointer Type Component Type and introduces gather/scatter instructions. It will be useful for explicitly vectorized kernels. Spec: intel/llvm#6613 Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com
1 parent 2b4ce42 commit 49b08e8

File tree

13 files changed

+411
-10
lines changed

13 files changed

+411
-10
lines changed

include/LLVMSPIRVExtensions.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ EXT(SPV_INTEL_global_variable_decorations)
5454
EXT(SPV_INTEL_non_constant_addrspace_printf)
5555
EXT(SPV_INTEL_complex_float_mul_div)
5656
EXT(SPV_INTEL_split_barrier)
57+
EXT(SPV_INTEL_masked_gather_scatter)

lib/SPIRV/SPIRVReader.cpp

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,7 +2130,12 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
21302130
case OpInBoundsPtrAccessChain: {
21312131
auto AC = static_cast<SPIRVAccessChainBase *>(BV);
21322132
auto Base = transValue(AC->getBase(), F, BB);
2133-
Type *BaseTy = transType(AC->getBase()->getType()->getPointerElementType());
2133+
SPIRVType *BaseSPVTy = AC->getBase()->getType();
2134+
Type *BaseTy =
2135+
BaseSPVTy->isTypeVector()
2136+
? transType(
2137+
BaseSPVTy->getVectorComponentType()->getPointerElementType())
2138+
: transType(BaseSPVTy->getPointerElementType());
21342139
auto Index = transValue(AC->getIndices(), F, BB);
21352140
if (!AC->hasPtrIndex())
21362141
Index.insert(Index.begin(), getInt32(M, 0));
@@ -2543,6 +2548,29 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
25432548
return mapValue(
25442549
BV, Builder.CreateIntrinsic(Intrinsic::arithmetic_fence, RetTy, Val));
25452550
}
2551+
case internal::OpMaskedGatherINTEL: {
2552+
IRBuilder<> Builder(BB);
2553+
auto *Inst = static_cast<SPIRVMaskedGatherINTELInst *>(BV);
2554+
Type *RetTy = transType(Inst->getType());
2555+
Value *PtrVector = transValue(Inst->getOperand(0), F, BB);
2556+
uint32_t Alignment = Inst->getOpWord(1);
2557+
Value *Mask = transValue(Inst->getOperand(2), F, BB);
2558+
Value *FillEmpty = transValue(Inst->getOperand(3), F, BB);
2559+
return mapValue(BV, Builder.CreateMaskedGather(RetTy, PtrVector,
2560+
Align(Alignment), Mask,
2561+
FillEmpty));
2562+
}
2563+
2564+
case internal::OpMaskedScatterINTEL: {
2565+
IRBuilder<> Builder(BB);
2566+
auto *Inst = static_cast<SPIRVMaskedScatterINTELInst *>(BV);
2567+
Value *InputVector = transValue(Inst->getOperand(0), F, BB);
2568+
Value *PtrVector = transValue(Inst->getOperand(1), F, BB);
2569+
uint32_t Alignment = Inst->getOpWord(2);
2570+
Value *Mask = transValue(Inst->getOperand(3), F, BB);
2571+
return mapValue(BV, Builder.CreateMaskedScatter(InputVector, PtrVector,
2572+
Align(Alignment), Mask));
2573+
}
25462574

25472575
default: {
25482576
auto OC = BV->getOpCode();
@@ -3150,7 +3178,11 @@ std::string getSPIRVFuncSuffix(SPIRVInstruction *BI) {
31503178
}
31513179
if (BI->getOpCode() == OpGenericCastToPtrExplicit) {
31523180
Suffix += kSPIRVPostfix::Divider;
3153-
auto GenericCastToPtrInst = BI->getType()->getPointerStorageClass();
3181+
auto *Ty = BI->getType();
3182+
auto GenericCastToPtrInst =
3183+
Ty->isTypeVectorPointer()
3184+
? Ty->getVectorComponentType()->getPointerStorageClass()
3185+
: Ty->getPointerStorageClass();
31543186
switch (GenericCastToPtrInst) {
31553187
case StorageClassCrossWorkgroup:
31563188
Suffix += std::string(kSPIRVPostfix::ToGlobal);

lib/SPIRV/SPIRVRegularizeLLVM.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,11 +543,19 @@ bool SPIRVRegularizeLLVMBase::regularize() {
543543
// Add an additional bitcast in case address space cast also changes
544544
// pointer element type.
545545
if (auto *ASCast = dyn_cast<AddrSpaceCastInst>(&II)) {
546-
PointerType *DestTy = cast<PointerType>(ASCast->getDestTy());
547-
PointerType *SrcTy = cast<PointerType>(ASCast->getSrcTy());
548-
if (!DestTy->hasSameElementTypeAs(SrcTy)) {
549-
PointerType *InterTy = PointerType::getWithSamePointeeType(
550-
DestTy, SrcTy->getPointerAddressSpace());
546+
Type *DestTy = ASCast->getDestTy();
547+
Type *SrcTy = ASCast->getSrcTy();
548+
if (!II.getContext().supportsTypedPointers())
549+
continue;
550+
if (DestTy->getScalarType()->getNonOpaquePointerElementType() !=
551+
SrcTy->getScalarType()->getNonOpaquePointerElementType()) {
552+
Type *InterTy = PointerType::getWithSamePointeeType(
553+
cast<PointerType>(DestTy->getScalarType()),
554+
cast<PointerType>(SrcTy->getScalarType())
555+
->getPointerAddressSpace());
556+
if (DestTy->isVectorTy())
557+
InterTy = VectorType::get(
558+
InterTy, cast<VectorType>(DestTy)->getElementCount());
551559
BitCastInst *NewBCast = new BitCastInst(
552560
ASCast->getPointerOperand(), InterTy, /*NameStr=*/"", ASCast);
553561
AddrSpaceCastInst *NewASCast =

lib/SPIRV/SPIRVWriter.cpp

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,28 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
342342
return transPointerType(ET, AddrSpc);
343343
}
344344

345-
if (auto *VecTy = dyn_cast<FixedVectorType>(T))
345+
if (auto *VecTy = dyn_cast<FixedVectorType>(T)) {
346+
if (VecTy->getElementType()->isPointerTy()) {
347+
// SPV_INTEL_masked_gather_scatter extension changes 2.16.1. Universal
348+
// Validation Rules:
349+
// Vector types must be parameterized only with numerical types,
350+
// [Physical Pointer Type] types or the [OpTypeBool] type.
351+
// Without it vector of pointers is not allowed in SPIR-V.
352+
if (!BM->isAllowedToUseExtension(
353+
ExtensionID::SPV_INTEL_masked_gather_scatter)) {
354+
BM->getErrorLog().checkError(
355+
false, SPIRVEC_RequiresExtension,
356+
"SPV_INTEL_masked_gather_scatter\n"
357+
"NOTE: LLVM module contains vector of pointers, translation "
358+
"of which requires this extension");
359+
return nullptr;
360+
}
361+
BM->addExtension(ExtensionID::SPV_INTEL_masked_gather_scatter);
362+
BM->addCapability(internal::CapabilityMaskedGatherScatterINTEL);
363+
}
346364
return mapType(T, BM->addVectorType(transType(VecTy->getElementType()),
347365
VecTy->getNumElements()));
366+
}
348367

349368
if (T->isArrayTy()) {
350369
// SPIR-V 1.3 s3.32.6: Length is the number of elements in the array.
@@ -3835,6 +3854,47 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
38353854
}
38363855
return Op;
38373856
}
3857+
case Intrinsic::masked_gather: {
3858+
if (!BM->isAllowedToUseExtension(
3859+
ExtensionID::SPV_INTEL_masked_gather_scatter)) {
3860+
BM->getErrorLog().checkError(
3861+
BM->isUnknownIntrinsicAllowed(II), SPIRVEC_InvalidFunctionCall, II,
3862+
"Translation of llvm.masked.gather intrinsic requires "
3863+
"SPV_INTEL_masked_gather_scatter extension or "
3864+
"-spirv-allow-unknown-intrinsics option.");
3865+
return nullptr;
3866+
}
3867+
SPIRVType *Ty = transType(II->getType());
3868+
auto *PtrVector = transValue(II->getArgOperand(0), BB);
3869+
uint32_t Alignment =
3870+
cast<ConstantInt>(II->getArgOperand(1))->getZExtValue();
3871+
auto *Mask = transValue(II->getArgOperand(2), BB);
3872+
auto *FillEmpty = transValue(II->getArgOperand(3), BB);
3873+
std::vector<SPIRVWord> Ops = {PtrVector->getId(), Alignment, Mask->getId(),
3874+
FillEmpty->getId()};
3875+
return BM->addInstTemplate(internal::OpMaskedGatherINTEL, Ops, BB, Ty);
3876+
}
3877+
case Intrinsic::masked_scatter: {
3878+
if (!BM->isAllowedToUseExtension(
3879+
ExtensionID::SPV_INTEL_masked_gather_scatter)) {
3880+
BM->getErrorLog().checkError(
3881+
BM->isUnknownIntrinsicAllowed(II), SPIRVEC_InvalidFunctionCall, II,
3882+
"Translation of llvm.masked.scatter intrinsic requires "
3883+
"SPV_INTEL_masked_gather_scatter extension or "
3884+
"-spirv-allow-unknown-intrinsics option.");
3885+
return nullptr;
3886+
}
3887+
auto *InputVector = transValue(II->getArgOperand(0), BB);
3888+
auto *PtrVector = transValue(II->getArgOperand(1), BB);
3889+
uint32_t Alignment =
3890+
cast<ConstantInt>(II->getArgOperand(2))->getZExtValue();
3891+
auto *Mask = transValue(II->getArgOperand(3), BB);
3892+
std::vector<SPIRVWord> Ops = {InputVector->getId(), PtrVector->getId(),
3893+
Alignment, Mask->getId()};
3894+
return BM->addInstTemplate(internal::OpMaskedScatterINTEL, Ops, BB,
3895+
nullptr);
3896+
}
3897+
38383898
default:
38393899
if (BM->isUnknownIntrinsicAllowed(II))
38403900
return BM->addCallInst(

lib/SPIRV/libSPIRV/SPIRVInstruction.h

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,6 +3413,154 @@ class SPIRVComplexFloatInst
34133413
_SPIRV_OP(ComplexFMulINTEL)
34143414
_SPIRV_OP(ComplexFDivINTEL)
34153415
#undef _SPIRV_OP
3416+
3417+
class SPIRVMaskedGatherScatterINTELInstBase : public SPIRVInstTemplateBase {
3418+
protected:
3419+
SPIRVCapVec getRequiredCapability() const override {
3420+
return getVec(internal::CapabilityMaskedGatherScatterINTEL);
3421+
}
3422+
llvm::Optional<ExtensionID> getRequiredExtension() const override {
3423+
return ExtensionID::SPV_INTEL_masked_gather_scatter;
3424+
}
3425+
};
3426+
3427+
class SPIRVMaskedGatherINTELInst
3428+
: public SPIRVMaskedGatherScatterINTELInstBase {
3429+
void validate() const override {
3430+
SPIRVInstruction::validate();
3431+
SPIRVErrorLog &SPVErrLog = this->getModule()->getErrorLog();
3432+
std::string InstName = "MaskedGatherINTEL";
3433+
3434+
SPIRVType *ResTy = this->getType();
3435+
SPVErrLog.checkError(ResTy->isTypeVector(), SPIRVEC_InvalidInstruction,
3436+
InstName + "\nResult must be a vector type\n");
3437+
SPIRVWord ResCompCount = ResTy->getVectorComponentCount();
3438+
SPIRVType *ResCompTy = ResTy->getVectorComponentType();
3439+
3440+
SPIRVValue *PtrVec =
3441+
const_cast<SPIRVMaskedGatherINTELInst *>(this)->getOperand(0);
3442+
SPIRVType *PtrVecTy = PtrVec->getType();
3443+
SPVErrLog.checkError(
3444+
PtrVecTy->isTypeVectorPointer(), SPIRVEC_InvalidInstruction,
3445+
InstName + "\nPtrVector must be a vector of pointers type\n");
3446+
SPIRVWord PtrVecCompCount = PtrVecTy->getVectorComponentCount();
3447+
SPIRVType *PtrVecCompTy = PtrVecTy->getVectorComponentType();
3448+
SPIRVType *PtrElemTy = PtrVecCompTy->getPointerElementType();
3449+
3450+
SPVErrLog.checkError(
3451+
this->isOperandLiteral(1), SPIRVEC_InvalidInstruction,
3452+
InstName + "\nAlignment must be a constant expression integer\n");
3453+
const uint32_t Align =
3454+
static_cast<SPIRVConstant *>(
3455+
const_cast<SPIRVMaskedGatherINTELInst *>(this)->getOperand(2))
3456+
->getZExtIntValue();
3457+
SPVErrLog.checkError(
3458+
((Align & (Align - 1)) == 0), SPIRVEC_InvalidInstruction,
3459+
InstName + "\nAlignment must be 0 or power-of-two integer\n");
3460+
3461+
SPIRVValue *Mask =
3462+
const_cast<SPIRVMaskedGatherINTELInst *>(this)->getOperand(2);
3463+
SPIRVType *MaskTy = Mask->getType();
3464+
SPVErrLog.checkError(MaskTy->isTypeVector(), SPIRVEC_InvalidInstruction,
3465+
InstName + "\nMask must be a vector type\n");
3466+
SPIRVType *MaskCompTy = MaskTy->getVectorComponentType();
3467+
SPVErrLog.checkError(MaskCompTy->isTypeBool(), SPIRVEC_InvalidInstruction,
3468+
InstName + "\nMask must be a boolean vector type\n");
3469+
SPIRVWord MaskCompCount = MaskTy->getVectorComponentCount();
3470+
3471+
SPIRVValue *FillEmpty =
3472+
const_cast<SPIRVMaskedGatherINTELInst *>(this)->getOperand(3);
3473+
SPIRVType *FillEmptyTy = FillEmpty->getType();
3474+
SPVErrLog.checkError(FillEmptyTy->isTypeVector(),
3475+
SPIRVEC_InvalidInstruction,
3476+
InstName + "\nFillEmpty must be a vector type\n");
3477+
SPIRVWord FillEmptyCompCount = FillEmptyTy->getVectorComponentCount();
3478+
SPIRVType *FillEmptyCompTy = FillEmptyTy->getVectorComponentType();
3479+
3480+
SPVErrLog.checkError(
3481+
ResCompCount == PtrVecCompCount &&
3482+
PtrVecCompCount == FillEmptyCompCount &&
3483+
FillEmptyCompCount == MaskCompCount,
3484+
SPIRVEC_InvalidInstruction,
3485+
InstName + "\nResult, PtrVector, Mask and FillEmpty vectors must have "
3486+
"the same size\n");
3487+
3488+
SPVErrLog.checkError(
3489+
ResCompTy == PtrElemTy && PtrElemTy == FillEmptyCompTy,
3490+
SPIRVEC_InvalidInstruction,
3491+
InstName + "\nComponent Type of Result and FillEmpty vector must be "
3492+
"same as base type of PtrVector the same base type\n");
3493+
}
3494+
};
3495+
3496+
class SPIRVMaskedScatterINTELInst
3497+
: public SPIRVMaskedGatherScatterINTELInstBase {
3498+
void validate() const override {
3499+
SPIRVInstruction::validate();
3500+
SPIRVErrorLog &SPVErrLog = this->getModule()->getErrorLog();
3501+
std::string InstName = "MaskedScatterINTEL";
3502+
3503+
SPIRVValue *InputVec =
3504+
const_cast<SPIRVMaskedScatterINTELInst *>(this)->getOperand(0);
3505+
SPIRVType *InputVecTy = InputVec->getType();
3506+
SPVErrLog.checkError(
3507+
InputVecTy->isTypeVector(), SPIRVEC_InvalidInstruction,
3508+
InstName + "\nInputVector must be a vector of pointers type\n");
3509+
SPIRVWord InputVecCompCount = InputVecTy->getVectorComponentCount();
3510+
SPIRVType *InputVecCompTy = InputVecTy->getVectorComponentType();
3511+
3512+
SPIRVValue *PtrVec =
3513+
const_cast<SPIRVMaskedScatterINTELInst *>(this)->getOperand(1);
3514+
SPIRVType *PtrVecTy = PtrVec->getType();
3515+
SPVErrLog.checkError(
3516+
PtrVecTy->isTypeVectorPointer(), SPIRVEC_InvalidInstruction,
3517+
InstName + "\nPtrVector must be a vector of pointers type\n");
3518+
SPIRVWord PtrVecCompCount = PtrVecTy->getVectorComponentCount();
3519+
SPIRVType *PtrVecCompTy = PtrVecTy->getVectorComponentType();
3520+
SPIRVType *PtrElemTy = PtrVecCompTy->getPointerElementType();
3521+
3522+
SPVErrLog.checkError(
3523+
this->isOperandLiteral(2), SPIRVEC_InvalidInstruction,
3524+
InstName + "\nAlignment must be a constant expression integer\n");
3525+
const uint32_t Align =
3526+
static_cast<SPIRVConstant *>(
3527+
const_cast<SPIRVMaskedScatterINTELInst *>(this)->getOperand(2))
3528+
->getZExtIntValue();
3529+
SPVErrLog.checkError(
3530+
((Align & (Align - 1)) == 0), SPIRVEC_InvalidInstruction,
3531+
InstName + "\nAlignment must be 0 or power-of-two integer\n");
3532+
3533+
SPIRVValue *Mask =
3534+
const_cast<SPIRVMaskedScatterINTELInst *>(this)->getOperand(2);
3535+
SPIRVType *MaskTy = Mask->getType();
3536+
SPVErrLog.checkError(MaskTy->isTypeVector(), SPIRVEC_InvalidInstruction,
3537+
InstName + "\nMask must be a vector type\n");
3538+
SPIRVType *MaskCompTy = MaskTy->getVectorComponentType();
3539+
SPVErrLog.checkError(MaskCompTy->isTypeBool(), SPIRVEC_InvalidInstruction,
3540+
InstName + "\nMask must be a boolean vector type\n");
3541+
SPIRVWord MaskCompCount = MaskTy->getVectorComponentCount();
3542+
3543+
SPVErrLog.checkError(
3544+
InputVecCompCount == PtrVecCompCount &&
3545+
PtrVecCompCount == MaskCompCount,
3546+
SPIRVEC_InvalidInstruction,
3547+
InstName + "\nInputVector, PtrVector and Mask vectors must have "
3548+
"the same size\n");
3549+
3550+
SPVErrLog.checkError(
3551+
InputVecCompTy == PtrElemTy, SPIRVEC_InvalidInstruction,
3552+
InstName + "\nComponent Type of InputVector must be "
3553+
"same as base type of PtrVector the same base type\n");
3554+
}
3555+
};
3556+
3557+
#define _SPIRV_OP(x, ...) \
3558+
typedef SPIRVInstTemplate<SPIRVMaskedGatherScatterINTELInstBase, \
3559+
internal::Op##x##INTEL, __VA_ARGS__> \
3560+
SPIRV##x##INTEL;
3561+
_SPIRV_OP(MaskedGather, true, 7)
3562+
_SPIRV_OP(MaskedScatter, false, 5)
3563+
#undef _SPIRV_OP
34163564
} // namespace SPIRV
34173565

34183566
#endif // SPIRV_LIBSPIRV_SPIRVINSTRUCTION_H

lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ template <> inline void SPIRVMap<Capability, std::string>::init() {
617617
add(internal::CapabilityNonConstantAddrspacePrintfINTEL,
618618
"NonConstantAddrspacePrintfINTEL");
619619
add(internal::CapabilityComplexFloatMulDivINTEL, "ComplexFloatMulDivINTEL");
620+
add(internal::CapabilityMaskedGatherScatterINTEL, "MaskedGatherScatterINTEL");
620621
}
621622
SPIRV_DEF_NAMEMAP(Capability, SPIRVCapabilityNameMap)
622623

lib/SPIRV/libSPIRV/SPIRVOpCodeEnumInternal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ _SPIRV_OP_INTERNAL(JointMatrixWorkItemLengthINTEL,
1313
internal::OpJointMatrixWorkItemLengthINTEL)
1414
_SPIRV_OP_INTERNAL(ComplexFMulINTEL, internal::ComplexFMulINTEL)
1515
_SPIRV_OP_INTERNAL(ComplexFDivINTEL, internal::ComplexFDivINTEL)
16+
_SPIRV_OP_INTERNAL(MaskedGatherINTEL, internal::OpMaskedGatherINTEL)
17+
_SPIRV_OP_INTERNAL(MaskedScatterINTEL, internal::OpMaskedScatterINTEL)

lib/SPIRV/libSPIRV/SPIRVType.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ bool SPIRVType::isTypeVectorOrScalarBool() const {
218218
return isTypeBool() || isTypeVectorBool();
219219
}
220220

221+
bool SPIRVType::isTypeVectorPointer() const {
222+
return isTypeVector() && getVectorComponentType()->isTypePointer();
223+
}
224+
221225
bool SPIRVType::isTypeSubgroupAvcINTEL() const {
222226
return isSubgroupAvcINTELTypeOpCode(OpCode);
223227
}

lib/SPIRV/libSPIRV/SPIRVType.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class SPIRVType : public SPIRVEntry {
102102
bool isTypeVectorOrScalarInt() const;
103103
bool isTypeVectorOrScalarFloat() const;
104104
bool isTypeVectorOrScalarBool() const;
105+
bool isTypeVectorPointer() const;
105106
bool isTypeSubgroupAvcINTEL() const;
106107
bool isTypeSubgroupAvcMceINTEL() const;
107108
};

lib/SPIRV/libSPIRV/spirv_internal.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ enum InternalOp {
4646
IOpJointMatrixWorkItemLengthINTEL = 6410,
4747
IOpComplexFMulINTEL = 6415,
4848
IOpComplexFDivINTEL = 6416,
49+
IOpMaskedGatherINTEL = 6428,
50+
IOpMaskedScatterINTEL = 6429,
4951
IOpPrev = OpMax - 2,
5052
IOpForward
5153
};
@@ -76,7 +78,8 @@ enum InternalCapability {
7678
ICapFPArithmeticFenceINTEL = 6144,
7779
ICapGlobalVariableDecorationsINTEL = 6146,
7880
ICapabilityNonConstantAddrspacePrintfINTEL = 6411,
79-
ICapabilityComplexFloatMulDivINTEL = 6414
81+
ICapabilityComplexFloatMulDivINTEL = 6414,
82+
ICapabilityMaskedGatherScatterINTEL = 6427
8083
};
8184

8285
enum InternalFunctionControlMask { IFunctionControlOptNoneINTELMask = 0x10000 };
@@ -124,6 +127,10 @@ _SPIRV_OP(Capability, NonConstantAddrspacePrintfINTEL)
124127
_SPIRV_OP(Capability, ComplexFloatMulDivINTEL)
125128
_SPIRV_OP(Op, ComplexFMulINTEL)
126129
_SPIRV_OP(Op, ComplexFDivINTEL)
130+
131+
_SPIRV_OP(Capability, MaskedGatherScatterINTEL)
132+
_SPIRV_OP(Op, MaskedGatherINTEL)
133+
_SPIRV_OP(Op, MaskedScatterINTEL)
127134
#undef _SPIRV_OP
128135

129136
constexpr Op OpForward = static_cast<Op>(IOpForward);

test/transcoding/SPV_INTEL_function_pointers/vector_elem.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llvm-as < %s | llvm-spirv -spirv-text --spirv-ext=+SPV_INTEL_function_pointers | FileCheck %s --check-prefix=CHECK-SPIRV
1+
; RUN: llvm-as < %s | llvm-spirv -spirv-text --spirv-ext=+SPV_INTEL_function_pointers,+SPV_INTEL_masked_gather_scatter | FileCheck %s --check-prefix=CHECK-SPIRV
22

33
; CHECK-SPIRV-DAG: 6 Name [[F1:[0-9+]]] "_Z2f1u2CMvb32_j"
44
; CHECK-SPIRV-DAG: 6 Name [[F2:[0-9+]]] "_Z2f2u2CMvb32_j"

0 commit comments

Comments
 (0)