From 54b8fa790eef6c6b563c4c312696ecca22d21917 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 8 Feb 2022 12:03:38 +0100 Subject: [PATCH] [NVPTXISelLowering] Use getByValSize() Instead of computing the size of the pointer element type. --- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp index 66d6702..74b38dc2 100644 --- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -1351,12 +1351,9 @@ std::string NVPTXTargetLowering::getPrototype( O << "_"; continue; } - auto *PTy = dyn_cast(Ty); - assert(PTy && "Param with byval attribute should be a pointer type"); - Type *ETy = PTy->getPointerElementType(); Align align = Outs[OIdx].Flags.getNonZeroByValAlign(); - unsigned sz = DL.getTypeAllocSize(ETy); + unsigned sz = Outs[OIdx].Flags.getByValSize(); O << ".param .align " << align.value() << " .b8 "; O << "_"; O << "[" << sz << "]"; -- 2.7.4