aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-02-08 12:20:08 +0100
committerNikita Popov <npopov@redhat.com>2022-02-09 09:40:27 +0100
commitff0b391600c77ca05a262bcca9e3d26aa333cfd0 (patch)
treec6f38e13faa2030d81117626b5550aacb7958693
parent69c3309d4545cd729c41b102303686e19c92f55c (diff)
downloadllvm-ff0b391600c77ca05a262bcca9e3d26aa333cfd0.zip
llvm-ff0b391600c77ca05a262bcca9e3d26aa333cfd0.tar.gz
llvm-ff0b391600c77ca05a262bcca9e3d26aa333cfd0.tar.bz2
[NVPTX] Remove image/sampler special case in call lowering
I suspect that this is dead code. There is no test coverage for this special case, and the struct type names this checks against don't seem to match what OpenCL actually generates (which would be %opencl.sampler_t rather than %struct._sampler_t for example). Motivation for this change is that this code is incompatible with opaque pointers -- simply deleting it is the simplest way of making it compatible :) Differential Revision: https://reviews.llvm.org/D119229
-rw-r--r--llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index e7a9ea5..4b59671 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -2426,26 +2426,6 @@ NVPTXTargetLowering::getParamSymbol(SelectionDAG &DAG, int idx, EVT v) const {
return DAG.getTargetExternalSymbol(SavedStr->c_str(), v);
}
-// Check to see if the kernel argument is image*_t or sampler_t
-
-static bool isImageOrSamplerVal(const Value *arg) {
- static const char *const specialTypes[] = { "struct._image2d_t",
- "struct._image3d_t",
- "struct._sampler_t" };
-
- Type *Ty = arg->getType();
- auto *PTy = dyn_cast<PointerType>(Ty);
-
- if (!PTy)
- return false;
-
- auto *STy = dyn_cast<StructType>(PTy->getPointerElementType());
- if (!STy || STy->isLiteral())
- return false;
-
- return llvm::is_contained(specialTypes, STy->getName());
-}
-
SDValue NVPTXTargetLowering::LowerFormalArguments(
SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
const SmallVectorImpl<ISD::InputArg> &Ins, const SDLoc &dl,
@@ -2487,16 +2467,6 @@ SDValue NVPTXTargetLowering::LowerFormalArguments(
for (unsigned i = 0, e = theArgs.size(); i != e; ++i, ++idx, ++InsIdx) {
Type *Ty = argTypes[i];
- // If the kernel argument is image*_t or sampler_t, convert it to
- // a i32 constant holding the parameter position. This can later
- // matched in the AsmPrinter to output the correct mangled name.
- if (isImageOrSamplerVal(theArgs[i])) {
- assert(isKernelFunction(*F) &&
- "Only kernels can have image/sampler params");
- InVals.push_back(DAG.getConstant(i + 1, dl, MVT::i32));
- continue;
- }
-
if (theArgs[i]->use_empty()) {
// argument is dead
if (Ty->isAggregateType() || Ty->isIntegerTy(128)) {