Skip to content

Commit 54b8fa7

Browse files
committed
[NVPTXISelLowering] Use getByValSize()
Instead of computing the size of the pointer element type.
1 parent f231599 commit 54b8fa7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,12 +1351,9 @@ std::string NVPTXTargetLowering::getPrototype(
13511351
O << "_";
13521352
continue;
13531353
}
1354-
auto *PTy = dyn_cast<PointerType>(Ty);
1355-
assert(PTy && "Param with byval attribute should be a pointer type");
1356-
Type *ETy = PTy->getPointerElementType();
13571354

13581355
Align align = Outs[OIdx].Flags.getNonZeroByValAlign();
1359-
unsigned sz = DL.getTypeAllocSize(ETy);
1356+
unsigned sz = Outs[OIdx].Flags.getByValSize();
13601357
O << ".param .align " << align.value() << " .b8 ";
13611358
O << "_";
13621359
O << "[" << sz << "]";

0 commit comments

Comments
 (0)