[llvm] 54b8fa7 - [NVPTXISelLowering] Use getByValSize()
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 8 03:04:41 PST 2022
Author: Nikita Popov
Date: 2022-02-08T12:04:34+01:00
New Revision: 54b8fa790eef6c6b563c4c312696ecca22d21917
URL: https://github.com/llvm/llvm-project/commit/54b8fa790eef6c6b563c4c312696ecca22d21917
DIFF: https://github.com/llvm/llvm-project/commit/54b8fa790eef6c6b563c4c312696ecca22d21917.diff
LOG: [NVPTXISelLowering] Use getByValSize()
Instead of computing the size of the pointer element type.
Added:
Modified:
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index 66d670217dac..74b38dc2e706 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<PointerType>(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 << "]";
More information about the llvm-commits
mailing list