[PATCH] D101706: [NFC] Use getParamByValType instead of pointee type
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat May 1 21:02:16 PDT 2021
aeubanks created this revision.
Herald added subscribers: haicheng, hiraditya, eraman.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
To reduce dependence on pointee types for opaque pointers.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D101706
Files:
llvm/lib/Analysis/InlineCost.cpp
Index: llvm/lib/Analysis/InlineCost.cpp
===================================================================
--- llvm/lib/Analysis/InlineCost.cpp
+++ llvm/lib/Analysis/InlineCost.cpp
@@ -2444,7 +2444,7 @@
// 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101706.342200.patch
Type: text/x-patch
Size: 705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210502/8fc0c9d8/attachment.bin>
More information about the llvm-commits
mailing list