[PATCH] D99310: [deref] Handle byval/byref/sret/inalloc/preallocated arguments for deref-at-point semantics
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 25 10:15:39 PDT 2021
nikic added inline comments.
================
Comment at: llvm/lib/IR/Value.cpp:747
+ if (ArgMemTy->isSized())
+ return false;
+
----------------
reames wrote:
> nikic wrote:
> > Why is the check for a sized type necessary? For an unsized type there would be no dereferenceable bytes, but I don't think it's something that really affects canBeFreed itself?
> I don't know. It seemed like enough of a cornercase to preserve the conservative handling from elsewhere. I'm happy to remove it if you are confident doing so is correct.
The check in the getPointerDereferenceableBytes() implementation is present because we're querying the actual type size there, which is going to assert for unsized types. I'm reasonably sure that we don't need the check here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99310/new/
https://reviews.llvm.org/D99310
More information about the llvm-commits
mailing list