Skip to content

Commit d9dba4c

Browse files
committed
[NVPTXISelLowering] Remove unnecessary context parameter (NFCI)
The module context shouldn't be relevant here, and should never be null either.
1 parent 80267c8 commit d9dba4c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

+2-8
Original file line numberDiff line numberDiff line change
@@ -2428,7 +2428,7 @@ NVPTXTargetLowering::getParamSymbol(SelectionDAG &DAG, int idx, EVT v) const {
24282428

24292429
// Check to see if the kernel argument is image*_t or sampler_t
24302430

2431-
static bool isImageOrSamplerVal(const Value *arg, const Module *context) {
2431+
static bool isImageOrSamplerVal(const Value *arg) {
24322432
static const char *const specialTypes[] = { "struct._image2d_t",
24332433
"struct._image3d_t",
24342434
"struct._sampler_t" };
@@ -2439,9 +2439,6 @@ static bool isImageOrSamplerVal(const Value *arg, const Module *context) {
24392439
if (!PTy)
24402440
return false;
24412441

2442-
if (!context)
2443-
return false;
2444-
24452442
auto *STy = dyn_cast<StructType>(PTy->getPointerElementType());
24462443
if (!STy || STy->isLiteral())
24472444
return false;
@@ -2493,10 +2490,7 @@ SDValue NVPTXTargetLowering::LowerFormalArguments(
24932490
// If the kernel argument is image*_t or sampler_t, convert it to
24942491
// a i32 constant holding the parameter position. This can later
24952492
// matched in the AsmPrinter to output the correct mangled name.
2496-
if (isImageOrSamplerVal(
2497-
theArgs[i],
2498-
(theArgs[i]->getParent() ? theArgs[i]->getParent()->getParent()
2499-
: nullptr))) {
2493+
if (isImageOrSamplerVal(theArgs[i])) {
25002494
assert(isKernelFunction(*F) &&
25012495
"Only kernels can have image/sampler params");
25022496
InVals.push_back(DAG.getConstant(i + 1, dl, MVT::i32));

0 commit comments

Comments
 (0)