[PATCH] D87975: [IR] MaxObjSize Attribute
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 14 12:18:38 PDT 2020
jdoerfert added inline comments.
================
Comment at: llvm/lib/IR/Value.cpp:723
+ if (!AI->isArrayAllocation()) {
+ MaxObjSizeBytes = DL.getTypeStoreSize(AI->getAllocatedType());
+ }
----------------
atmnpatel wrote:
> efriedma wrote:
> > Can you use llvm::getObjectSize here, instead of rolling your own version that has bugs?
> I don't think we can, this check here is trying to offload the actual max object size calculation to the Attributor, while getObjectSize doesn't take the attributes into account at all (from what I can tell).
What @efriedma means is that you should not do the DL.getXXXXXSize lookup but instead do getObjSize which knows about corner cases.
This is the place where we only look at the IR and report properties. No analyses connections, just pure information retrieval from the IR, the "base case" for an analysis if you want.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87975/new/
https://reviews.llvm.org/D87975
More information about the llvm-commits
mailing list