[llvm] 07a9df5 - [NFC] Use getParamByValType instead of pointee type
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Sat May 1 21:22:59 PDT 2021
Author: Arthur Eubanks
Date: 2021-05-01T21:22:41-07:00
New Revision: 07a9df5993670318dd8028de84de1ae3f60fed22
URL: https://github.com/llvm/llvm-project/commit/07a9df5993670318dd8028de84de1ae3f60fed22
DIFF: https://github.com/llvm/llvm-project/commit/07a9df5993670318dd8028de84de1ae3f60fed22.diff
LOG: [NFC] Use getParamByValType instead of pointee type
To reduce dependence on pointee types for opaque pointers.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D101706
Added:
Modified:
llvm/lib/Analysis/InlineCost.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 91ac849f97b1..69cf28049b38 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -2444,7 +2444,7 @@ int llvm::getCallsiteCost(CallBase &Call, const DataLayout &DL) {
// We approximate the number of loads and stores needed by dividing the
// size of the byval type by the target's pointer size.
PointerType *PTy = cast<PointerType>(Call.getArgOperand(I)->getType());
- unsigned TypeSize = DL.getTypeSizeInBits(PTy->getElementType());
+ unsigned TypeSize = DL.getTypeSizeInBits(Call.getParamByValType(I));
unsigned AS = PTy->getAddressSpace();
unsigned PointerSize = DL.getPointerSizeInBits(AS);
// Ceiling division.
More information about the llvm-commits
mailing list