Skip to content

Commit 5ce6a99

Browse files
[NFCI] Use TypedPointerType in more places. (#1683)
One of the reasons behind this change is to make code more easily deal with the future prospect of opaque types, so that helper methods (like adjusting image types) can handle both pointer type and opaque type representations simply by querying if the input type is a TypedPointerType or an OpaqueType [name for the latter still pending]. The set of changes are: * OCLTypeToSPIRV now uses TypedPointerType internally * adaptSPIRVImageType and getSPIRVStructTypeByChangeBaseTypeName are collapsed into one method (adjustImageType) that works with TypedPointerTypes. * A few is*StructType methods have been reverted back to is*Type methods, taking a TypedPointerType parameter instead. * BuiltinCallHelper::addSPIRVCall{Pair} allows for the creation of SPIR-V calls that can use TypedPointerType or actual type for parameters and return value. * BuiltinCallHelper::getCallValue{Type} is a simple helper that hides many of the uses of getParameterTypes. * The Type* parameter of the callback in BuiltinCallMutator::mapArg now provides a TypedPointerType or the actual type, instead of the pointer element type. * BuiltinCallMutator::ValueTypePair similarly takes a TypedPointerType or the actual type. * getParameterTypes (when passed a SmallVector<Type *>) does a similar thing. (The SmallVector<TypedPointerType *> variant has been removed in favor of only using the other one.) Note that the last few changes do change the semantics of function parameters without changing the function name or signature. Co-authored-by: Dmitry Sidorov <[email protected]>
1 parent c1fe5fe commit 5ce6a99

15 files changed

+341
-320
lines changed

lib/SPIRV/OCLToSPIRV.cpp

Lines changed: 40 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -944,27 +944,24 @@ void OCLToSPIRVBase::visitCallReadImageWithSampler(CallInst *CI,
944944
assert(CI->getCalledFunction() && "Unexpected indirect call");
945945
Function *Func = CI->getCalledFunction();
946946
bool IsRetScalar = !CI->getType()->isVectorTy();
947-
SmallVector<Type *, 3> ArgStructTys;
948-
getParameterTypes(CI, ArgStructTys);
949947
Type *Ret = CI->getType();
950-
auto *ImageTy = OCLTypeToSPIRVPtr->getAdaptedArgumentType(Func, 0).second;
948+
auto *ImageTy = OCLTypeToSPIRVPtr->getAdaptedArgumentType(Func, 0);
951949
if (!ImageTy)
952-
ImageTy = ArgStructTys[0];
953-
ImageTy = adaptSPIRVImageType(M, ImageTy);
954-
auto *SampledImgStructTy = getSPIRVStructTypeByChangeBaseTypeName(
955-
M, ImageTy, kSPIRVTypeName::Image, kSPIRVTypeName::SampledImg);
956-
auto *SampledImgTy = PointerType::get(SampledImgStructTy, SPIRAS_Global);
957-
Value *SampledImgArgs[] = {CI->getArgOperand(0), CI->getArgOperand(1)};
958-
auto *SampledImg = addCallInstSPIRV(M, getSPIRVFuncName(OpSampledImage),
959-
SampledImgTy, SampledImgArgs, nullptr,
960-
{ArgStructTys[0], ArgStructTys[1]}, CI,
961-
kSPIRVName::TempSampledImage);
950+
ImageTy = getCallValueType(CI, 0);
962951

963952
auto Mutator = mutateCallInst(
964953
CI, getSPIRVFuncName(OpImageSampleExplicitLod,
965954
std::string(kSPIRVPostfix::ExtDivider) +
966955
getPostfixForReturnType(Ret)));
967-
Mutator.replaceArg(0, {SampledImg, SampledImgStructTy}).removeArg(1);
956+
Mutator.mapArg(0, [&](IRBuilder<> &Builder, Value *ImgArg, Type *ImgType) {
957+
auto *SampledImgTy = adjustImageType(ImageTy, kSPIRVTypeName::Image,
958+
kSPIRVTypeName::SampledImg);
959+
Value *SampledImgArgs[] = {CI->getArgOperand(0), CI->getArgOperand(1)};
960+
return addSPIRVCallPair(Builder, OpSampledImage, SampledImgTy,
961+
SampledImgArgs, {ImgType, Mutator.getType(1)},
962+
kSPIRVName::TempSampledImage);
963+
});
964+
Mutator.removeArg(1);
968965
unsigned ImgOpMask = getImageSignZeroExt(DemangledName);
969966
unsigned ImgOpMaskInsIndex = Mutator.arg_size();
970967
switch (Mutator.arg_size()) {
@@ -997,15 +994,7 @@ void OCLToSPIRVBase::visitCallReadImageWithSampler(CallInst *CI,
997994

998995
void OCLToSPIRVBase::visitCallGetImageSize(CallInst *CI,
999996
StringRef DemangledName) {
1000-
StringRef TyName;
1001-
SmallVector<StringRef, 4> SubStrs;
1002-
SmallVector<Type *, 4> ParamTys;
1003-
getParameterTypes(CI, ParamTys);
1004-
auto IsImg = isOCLImageStructType(ParamTys[0], &TyName);
1005-
(void)IsImg;
1006-
assert(IsImg);
1007-
std::string ImageTyName = getImageBaseTypeName(TyName);
1008-
auto Desc = map<SPIRVTypeImageDescriptor>(ImageTyName);
997+
auto Desc = getImageDescriptor(getCallValueType(CI, 0));
1009998
unsigned Dim = getImageDimension(Desc.Dim) + Desc.Arrayed;
1010999
assert(Dim > 0 && "Invalid image dimension.");
10111000
assert(CI->arg_size() == 1);
@@ -1131,8 +1120,10 @@ void OCLToSPIRVBase::visitCallToAddr(CallInst *CI, StringRef DemangledName) {
11311120
Mutator
11321121
.mapArg(Mutator.arg_size() - 1,
11331122
[&](Value *V) {
1134-
return std::pair<Value *, Type *>(
1135-
castToInt8Ptr(V, CI), Type::getInt8Ty(V->getContext()));
1123+
return std::make_pair(
1124+
castToInt8Ptr(V, CI),
1125+
TypedPointerType::get(Type::getInt8Ty(V->getContext()),
1126+
SPIRAS_Generic));
11361127
})
11371128
.appendArg(StorageClass);
11381129
};
@@ -1497,9 +1488,7 @@ void OCLToSPIRVBase::processSubgroupBlockReadWriteINTEL(
14971488
// reads and vector block reads.
14981489
void OCLToSPIRVBase::visitSubgroupBlockReadINTEL(CallInst *CI) {
14991490
OCLBuiltinTransInfo Info;
1500-
SmallVector<Type *, 2> ParamTys;
1501-
getParameterTypes(CI, ParamTys);
1502-
if (isOCLImageStructType(ParamTys[0]))
1491+
if (isOCLImageType(getCallValueType(CI, 0)))
15031492
Info.UniqName = getSPIRVFuncName(spv::OpSubgroupImageBlockReadINTEL);
15041493
else
15051494
Info.UniqName = getSPIRVFuncName(spv::OpSubgroupBlockReadINTEL);
@@ -1512,9 +1501,7 @@ void OCLToSPIRVBase::visitSubgroupBlockReadINTEL(CallInst *CI) {
15121501
// instructions.
15131502
void OCLToSPIRVBase::visitSubgroupBlockWriteINTEL(CallInst *CI) {
15141503
OCLBuiltinTransInfo Info;
1515-
SmallVector<Type *, 3> ParamTys;
1516-
getParameterTypes(CI, ParamTys);
1517-
if (isOCLImageStructType(ParamTys[0]))
1504+
if (isOCLImageType(getCallValueType(CI, 0)))
15181505
Info.UniqName = getSPIRVFuncName(spv::OpSubgroupImageBlockWriteINTEL);
15191506
else
15201507
Info.UniqName = getSPIRVFuncName(spv::OpSubgroupBlockWriteINTEL);
@@ -1614,7 +1601,7 @@ void OCLToSPIRVBase::visitSubgroupAVCWrapperBuiltinCall(
16141601
std::string MCETName =
16151602
std::string(kOCLSubgroupsAVCIntel::TypePrefix) + "mce_" + TyKind + "_t";
16161603
auto *MCESTy = getSubgroupAVCIntelMCEType(M, MCETName);
1617-
auto *MCETy = PointerType::get(MCESTy, SPIRAS_Private);
1604+
auto *MCETy = TypedPointerType::get(MCESTy, SPIRAS_Private);
16181605
std::string ToMCEFName = Prefix + OpKind + "_convert_to_mce_" + TyKind;
16191606
Op ToMCEOC = OpNop;
16201607
OCLSPIRVSubgroupAVCIntelBuiltinMap::find(ToMCEFName, &ToMCEOC);
@@ -1631,28 +1618,24 @@ void OCLToSPIRVBase::visitSubgroupAVCWrapperBuiltinCall(
16311618

16321619
mutateCallInst(CI, WrappedOC)
16331620
.mapArg(CI->arg_size() - 1,
1634-
[&](Value *Arg, Type *ParamTy) {
1621+
[&](IRBuilder<> &Builder, Value *Arg, Type *ParamTy) {
16351622
// Create conversion function call for the last operand
1636-
return std::pair<Value *, Type *>(
1637-
addCallInstSPIRV(M, getSPIRVFuncName(ToMCEOC), MCETy, Arg,
1638-
nullptr, {ParamTy}, CI, ""),
1639-
MCESTy);
1623+
return addSPIRVCallPair(Builder, ToMCEOC, MCETy, {Arg},
1624+
{ParamTy});
16401625
})
1641-
.changeReturnType(MCETy, [=](IRBuilder<> &, CallInst *NewCI) {
1626+
.changeReturnType(MCETy, [&](IRBuilder<> &Builder, CallInst *NewCI) {
16421627
// Create conversion function call for the return result
1643-
return addCallInstSPIRV(M, getSPIRVFuncName(FromMCEOC), CI->getType(),
1644-
NewCI, nullptr, {MCESTy}, CI, "");
1628+
return addSPIRVCall(Builder, FromMCEOC, CI->getType(), {NewCI},
1629+
{MCETy});
16451630
});
16461631
} else {
16471632
// Wrapper built-ins which take the 'result_t' argument requires only one
16481633
// conversion for the argument
16491634
mutateCallInst(CI, WrappedOC)
1650-
.mapArg(CI->arg_size() - 1, [&](Value *Arg, Type *ParamTy) {
1635+
.mapArg(CI->arg_size() - 1, [&](IRBuilder<> &Builder, Value *Arg,
1636+
Type *ParamTy) {
16511637
// Create conversion function call for the last operand
1652-
return std::pair<Value *, Type *>(
1653-
addCallInstSPIRV(M, getSPIRVFuncName(ToMCEOC), MCETy, Arg,
1654-
nullptr, {ParamTy}, CI, ""),
1655-
MCESTy);
1638+
return addSPIRVCallPair(Builder, ToMCEOC, MCETy, {Arg}, {ParamTy});
16561639
});
16571640
}
16581641
}
@@ -1676,9 +1659,8 @@ void OCLToSPIRVBase::visitSubgroupAVCBuiltinCallWithSampler(
16761659
return; // this is not a VME built-in
16771660

16781661
SmallVector<Type *, 4> ParamTys;
1679-
getParameterTypes(CI, ParamTys);
1680-
auto *TyIt =
1681-
std::find_if(ParamTys.begin(), ParamTys.end(), isSamplerStructTy);
1662+
getParameterTypes(CI->getCalledFunction(), ParamTys);
1663+
auto *TyIt = std::find_if(ParamTys.begin(), ParamTys.end(), isSamplerTy);
16821664
assert(TyIt != ParamTys.end() && "Invalid Subgroup AVC Intel built-in call");
16831665
unsigned SamplerIndex = TyIt - ParamTys.begin();
16841666
Value *SamplerVal = CI->getOperand(SamplerIndex);
@@ -1687,30 +1669,24 @@ void OCLToSPIRVBase::visitSubgroupAVCBuiltinCallWithSampler(
16871669
SmallVector<Type *, 4> AdaptedTys;
16881670
for (unsigned I = 0; I < CI->arg_size(); I++)
16891671
AdaptedTys.push_back(
1690-
OCLTypeToSPIRVPtr->getAdaptedArgumentType(CI->getCalledFunction(), I)
1691-
.second);
1672+
OCLTypeToSPIRVPtr->getAdaptedArgumentType(CI->getCalledFunction(), I));
16921673
auto *AdaptedIter = AdaptedTys.begin();
16931674

16941675
mutateCallInst(CI, OC)
1695-
.mapArgs([&](Value *Arg, Type *PointerTy) {
1696-
if (!isOCLImageStructType(PointerTy))
1697-
return std::make_pair(Arg, PointerTy);
1676+
.mapArgs([&](IRBuilder<> &Builder, Value *Arg, Type *ArgTy) {
1677+
if (!isOCLImageType(ArgTy))
1678+
return BuiltinCallMutator::ValueTypePair(Arg, ArgTy);
16981679

16991680
auto *ImageTy = *AdaptedIter++;
17001681
if (!ImageTy)
1701-
ImageTy = PointerTy;
1702-
ImageTy = adaptSPIRVImageType(M, ImageTy);
1703-
auto *SampledImgStructTy = getSPIRVStructTypeByChangeBaseTypeName(
1704-
M, ImageTy, kSPIRVTypeName::Image, kSPIRVTypeName::VmeImageINTEL);
1705-
auto *SampledImgTy =
1706-
PointerType::get(SampledImgStructTy, SPIRAS_Global);
1682+
ImageTy = ArgTy;
1683+
auto *SampledImgTy = adjustImageType(ImageTy, kSPIRVTypeName::Image,
1684+
kSPIRVTypeName::VmeImageINTEL);
17071685

17081686
Value *SampledImgArgs[] = {Arg, SamplerVal};
1709-
return std::pair<Value *, Type *>(
1710-
addCallInstSPIRV(M, getSPIRVFuncName(OpVmeImageINTEL), SampledImgTy,
1711-
SampledImgArgs, nullptr, {PointerTy, SamplerTy},
1712-
CI, kSPIRVName::TempSampledImage),
1713-
SampledImgStructTy);
1687+
return addSPIRVCallPair(Builder, OpVmeImageINTEL, SampledImgTy,
1688+
SampledImgArgs, {ArgTy, SamplerTy},
1689+
kSPIRVName::TempSampledImage);
17141690
})
17151691
.removeArg(SamplerIndex);
17161692
}

lib/SPIRV/OCLTypeToSPIRV.cpp

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,11 @@ bool OCLTypeToSPIRVBase::runOCLTypeToSPIRV(Module &Module) {
106106
return false;
107107
}
108108

109-
void OCLTypeToSPIRVBase::addAdaptedType(Value *V, Type *Ty,
110-
unsigned AddrSpace) {
109+
void OCLTypeToSPIRVBase::addAdaptedType(Value *V, Type *Ty) {
111110
LLVM_DEBUG(dbgs() << "[add adapted type] ";
112111
V->printAsOperand(dbgs(), true, M);
113112
dbgs() << " => " << *Ty << '\n');
114-
AdaptedTy[V] = {Ty, AddrSpace};
113+
AdaptedTy[V] = Ty;
115114
}
116115

117116
void OCLTypeToSPIRVBase::addWork(Function *F) {
@@ -133,17 +132,16 @@ void OCLTypeToSPIRVBase::adaptFunction(Function *F) {
133132
auto Loc = AdaptedTy.find(&I);
134133
auto Found = (Loc != AdaptedTy.end());
135134
Changed |= Found;
136-
ArgTys.push_back(Found ? Loc->second.first : I.getType());
135+
ArgTys.push_back(Found ? Loc->second : I.getType());
137136

138137
if (Found) {
139-
auto *Ty = Loc->second.first;
140-
unsigned AddrSpace = Loc->second.second;
138+
Type *Ty = Loc->second;
141139
for (auto &U : I.uses()) {
142140
if (auto *CI = dyn_cast<CallInst>(U.getUser())) {
143141
auto ArgIndex = CI->getArgOperandNo(&U);
144142
auto CF = CI->getCalledFunction();
145143
if (AdaptedTy.count(CF) == 0) {
146-
addAdaptedType(CF->getArg(ArgIndex), Ty, AddrSpace);
144+
addAdaptedType(CF->getArg(ArgIndex), Ty);
147145
addWork(CF);
148146
}
149147
}
@@ -156,7 +154,7 @@ void OCLTypeToSPIRVBase::adaptFunction(Function *F) {
156154

157155
auto FT = F->getFunctionType();
158156
FT = FunctionType::get(FT->getReturnType(), ArgTys, FT->isVarArg());
159-
addAdaptedType(F, FT, 0);
157+
addAdaptedType(F, TypedPointerType::get(FT, 0));
160158
}
161159

162160
// Handle functions with sampler arguments that don't get called by
@@ -181,7 +179,8 @@ void OCLTypeToSPIRVBase::adaptArgumentsBySamplerUse(Module &M) {
181179
AdaptedTy.count(SamplerArg) != 0) // Already traced this, move on.
182180
continue;
183181

184-
addAdaptedType(SamplerArg, getSamplerStructType(&M), SPIRAS_Constant);
182+
addAdaptedType(SamplerArg, TypedPointerType::get(getSamplerStructType(&M),
183+
SPIRAS_Constant));
185184
auto Caller = cast<Argument>(SamplerArg)->getParent();
186185
addWork(Caller);
187186
TraceArg(Caller, cast<Argument>(SamplerArg)->getArgNo());
@@ -209,26 +208,27 @@ void OCLTypeToSPIRVBase::adaptFunctionArguments(Function *F) {
209208
bool Changed = false;
210209
auto Arg = F->arg_begin();
211210
SmallVector<Type *, 4> ParamTys;
212-
getParameterTypes(F, ParamTys);
213211

214212
// If we couldn't get any information from demangling, there is nothing that
215213
// can be done.
216-
if (ParamTys.empty())
214+
if (!getParameterTypes(F, ParamTys))
217215
return;
218216

219217
for (unsigned I = 0; I < F->arg_size(); ++I, ++Arg) {
220-
StructType *NewTy = dyn_cast_or_null<StructType>(ParamTys[I]);
218+
StructType *NewTy = nullptr;
219+
if (auto *TPT = dyn_cast<TypedPointerType>(ParamTys[I]))
220+
NewTy = dyn_cast_or_null<StructType>(TPT->getElementType());
221221
if (NewTy && NewTy->isOpaque()) {
222222
auto STName = NewTy->getStructName();
223223
if (!hasAccessQualifiedName(STName))
224224
continue;
225225
if (STName.startswith(kSPR2TypeName::ImagePrefix)) {
226226
auto Ty = STName.str();
227227
auto AccStr = getAccessQualifierFullName(Ty);
228-
addAdaptedType(
229-
&*Arg,
230-
getOrCreateOpaqueStructType(M, mapOCLTypeNameToSPIRV(Ty, AccStr)),
231-
SPIRAS_Global);
228+
addAdaptedType(&*Arg, TypedPointerType::get(
229+
getOrCreateOpaqueStructType(
230+
M, mapOCLTypeNameToSPIRV(Ty, AccStr)),
231+
SPIRAS_Global));
232232
Changed = true;
233233
}
234234
}
@@ -249,18 +249,19 @@ void OCLTypeToSPIRVBase::adaptArgumentsByMetadata(Function *F) {
249249
for (unsigned I = 0, E = TypeMD->getNumOperands(); I != E; ++I, ++Arg) {
250250
auto OCLTyStr = getMDOperandAsString(TypeMD, I);
251251
if (OCLTyStr == OCL_TYPE_NAME_SAMPLER_T) {
252-
addAdaptedType(&(*Arg), getSamplerStructType(M), SPIRAS_Constant);
252+
addAdaptedType(&(*Arg), TypedPointerType::get(getSamplerStructType(M),
253+
SPIRAS_Constant));
253254
Changed = true;
254255
} else if (OCLTyStr.startswith("image") && OCLTyStr.endswith("_t")) {
255256
auto Ty = (Twine("opencl.") + OCLTyStr).str();
256257
if (StructType::getTypeByName(F->getContext(), Ty)) {
257258
auto AccMD = F->getMetadata(SPIR_MD_KERNEL_ARG_ACCESS_QUAL);
258259
assert(AccMD && "Invalid access qualifier metadata");
259260
auto AccStr = getMDOperandAsString(AccMD, I);
260-
addAdaptedType(
261-
&(*Arg),
262-
getOrCreateOpaqueStructType(M, mapOCLTypeNameToSPIRV(Ty, AccStr)),
263-
SPIRAS_Global);
261+
addAdaptedType(&(*Arg), TypedPointerType::get(
262+
getOrCreateOpaqueStructType(
263+
M, mapOCLTypeNameToSPIRV(Ty, AccStr)),
264+
SPIRAS_Global));
264265
Changed = true;
265266
}
266267
}
@@ -297,15 +298,12 @@ void OCLTypeToSPIRVBase::adaptArgumentsByMetadata(Function *F) {
297298
// opencl data type x and access qualifier y, and use opencl.image_x.y to
298299
// represent image_x type with access qualifier y.
299300
//
300-
std::pair<Type *, Type *>
301-
OCLTypeToSPIRVBase::getAdaptedArgumentType(Function *F, unsigned ArgNo) {
301+
Type *OCLTypeToSPIRVBase::getAdaptedArgumentType(Function *F, unsigned ArgNo) {
302302
Value *Arg = F->getArg(ArgNo);
303303
auto Loc = AdaptedTy.find(Arg);
304304
if (Loc == AdaptedTy.end())
305-
return {nullptr, nullptr};
306-
Type *PointeeTy = Loc->second.first;
307-
Type *PointerTy = PointerType::get(PointeeTy, Loc->second.second);
308-
return {PointerTy, PointeeTy};
305+
return nullptr;
306+
return Loc->second;
309307
}
310308

311309
} // namespace SPIRV

lib/SPIRV/OCLTypeToSPIRV.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,22 @@ class OCLTypeToSPIRVBase {
5959

6060
bool runOCLTypeToSPIRV(llvm::Module &M);
6161

62-
/// Returns the adapted type of the corresponding argument for a function.
63-
/// The first value of the returned pair is the LLVM type of the argument.
64-
/// The second value of the returned pair is the pointer element type of the
65-
/// argument, if the type is a pointer.
66-
std::pair<llvm::Type *, llvm::Type *>
67-
getAdaptedArgumentType(llvm::Function *F, unsigned ArgNo);
62+
/// Returns the adapted type of the corresponding argument for a function. If
63+
/// the type is a pointer type, it will return a TypedPointerType instead.
64+
llvm::Type *getAdaptedArgumentType(llvm::Function *F, unsigned ArgNo);
6865

6966
private:
7067
llvm::Module *M;
7168
llvm::LLVMContext *Ctx;
72-
// Map of argument/Function -> {pointee type, address space}
73-
std::map<llvm::Value *, std::pair<llvm::Type *, unsigned>> AdaptedTy;
69+
// Map of argument/Function -> adapted type (probably TypedPointerType)
70+
std::map<llvm::Value *, llvm::Type *> AdaptedTy;
7471
std::set<llvm::Function *> WorkSet; // Functions to be adapted
7572

7673
void adaptFunctionArguments(llvm::Function *F);
7774
void adaptArgumentsByMetadata(llvm::Function *F);
7875
void adaptArgumentsBySamplerUse(llvm::Module &M);
7976
void adaptFunction(llvm::Function *F);
80-
void addAdaptedType(llvm::Value *V, llvm::Type *PointeeTy, unsigned AS);
77+
void addAdaptedType(llvm::Value *V, llvm::Type *Ty);
8178
void addWork(llvm::Function *F);
8279
};
8380

lib/SPIRV/OCLUtil.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,9 +1344,12 @@ Value *unwrapSpecialTypeInitializer(Value *V) {
13441344
return nullptr;
13451345
}
13461346

1347-
bool isSamplerStructTy(Type *Ty) {
1348-
auto *STy = dyn_cast_or_null<StructType>(Ty);
1349-
return STy && STy->hasName() && STy->getName() == kSPR2TypeName::Sampler;
1347+
bool isSamplerTy(Type *Ty) {
1348+
if (auto *TPT = dyn_cast_or_null<TypedPointerType>(Ty)) {
1349+
auto *STy = dyn_cast_or_null<StructType>(TPT->getElementType());
1350+
return STy && STy->hasName() && STy->getName() == kSPR2TypeName::Sampler;
1351+
}
1352+
return false;
13501353
}
13511354

13521355
bool isPipeOrAddressSpaceCastBI(const StringRef MangledName) {

lib/SPIRV/OCLUtil.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ bool isEnqueueKernelBI(const StringRef MangledName);
499499
bool isKernelQueryBI(const StringRef MangledName);
500500

501501
/// Check that the type is the sampler_t
502-
bool isSamplerStructTy(Type *Ty);
502+
bool isSamplerTy(Type *Ty);
503503

504504
// Checks if the binary operator is an unfused fmul + fadd instruction.
505505
bool isUnfusedMulAdd(BinaryOperator *B);

0 commit comments

Comments
 (0)