BasicBlockPass *createNVPTXLowerAllocaPass();
MachineFunctionPass *createNVPTXPeephole();
-bool isImageOrSamplerVal(const Value *, const Module *);
-
extern Target TheNVPTXTarget32;
extern Target TheNVPTXTarget64;
// Check to see if the kernel argument is image*_t or sampler_t
-bool llvm::isImageOrSamplerVal(const Value *arg, const Module *context) {
+static bool isImageOrSamplerVal(const Value *arg, const Module *context) {
static const char *const specialTypes[] = { "struct._image2d_t",
"struct._image3d_t",
"struct._sampler_t" };
return false;
auto *STy = dyn_cast<StructType>(PTy->getElementType());
- const std::string TypeName = STy && !STy->isLiteral() ? STy->getName() : "";
+ if (!STy || STy->isLiteral())
+ return false;
return std::find(std::begin(specialTypes), std::end(specialTypes),
- TypeName) != std::end(specialTypes);
+ STy->getName()) != std::end(specialTypes);
}
SDValue NVPTXTargetLowering::LowerFormalArguments(