[llvm-commits] [PATCH] Try to figure out <size> argument in llvm.lifetime intrinsics
Nick Lewycky
nlewycky at google.com
Mon Nov 12 15:34:56 PST 2012
675 if (IFI.TD != 0) {
The rest of the file and llvm use "if (IFI.TD)" style. Please fix.
LGTM!
On 12 November 2012 01:22, Alexey Samsonov <samsonov at google.com> wrote:
>
> Kostya is right about merging allocas - stack reuse won't be able to do
> anything if ASan is enabled.
>
>
> ================
> Comment at: lib/Transforms/Utils/InlineFunction.cpp:676
> @@ +675,3 @@
> + if (IFI.TD != 0) {
> + uint64_t SizeValue = AllocaArraySize->getLimitedValue();
> + Type *AllocaType = AI->getAllocatedType();
> ----------------
> Nick Lewycky wrote:
> > What if the array size is an i128, and greater than fits in a uint64_t?
> getLimitedValue() will return -1 (~0ULL). Maybe you want to bail in that
> case?
> Done
>
> ================
> Comment at: lib/Transforms/Utils/InlineFunction.cpp:678
> @@ +677,3 @@
> + Type *AllocaType = AI->getAllocatedType();
> + SizeValue *= IFI.TD->getTypeAllocSize(AllocaType);
> + AllocaSize =
> ConstantInt::get(Type::getInt64Ty(AI->getContext()),
> ----------------
> Nick Lewycky wrote:
> > What about overflow here?
> >
> > I don't know of any shared utility to multiply and detect overflow, but
> I've needed to do the exact same thing before. See umul_ov() at
> ScalarEvolution.cpp:1826.
> >
> Done
>
>
> http://llvm-reviews.chandlerc.com/D110
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121112/cf366545/attachment.html>
More information about the llvm-commits
mailing list