diff options
author | Arthur Eubanks <aeubanks@google.com> | 2021-05-01 21:01:06 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2021-05-01 21:22:41 -0700 |
commit | 07a9df5993670318dd8028de84de1ae3f60fed22 (patch) | |
tree | 0819b2e3eab0d85ec754b4c3dc7892c551dadabf /llvm/lib/Analysis/InlineCost.cpp | |
parent | e639bccefd3e862f775da047dd954ef8e5dc3b6a (diff) | |
download | llvm-07a9df5993670318dd8028de84de1ae3f60fed22.zip llvm-07a9df5993670318dd8028de84de1ae3f60fed22.tar.gz llvm-07a9df5993670318dd8028de84de1ae3f60fed22.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index 91ac849..69cf280 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. |