<div style="font-family:arial,helvetica,sans-serif;font-size:10pt">675        if (<a href="http://IFI.TD">IFI.TD</a> != 0) {<div><br></div><div>The rest of the file and llvm use "if (<a href="http://IFI.TD">IFI.TD</a>)" style. Please fix.</div>

<div><br></div><div>LGTM!<br><div><br><div class="gmail_quote">On 12 November 2012 01:22, Alexey Samsonov <span dir="ltr"><<a href="mailto:samsonov@google.com" target="_blank">samsonov@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  Kostya is right about merging allocas - stack reuse won't be able to do anything if ASan is enabled.<br>
<div class="im"><br>
<br>
================<br>
Comment at: lib/Transforms/Utils/InlineFunction.cpp:676<br>
@@ +675,3 @@<br>
</div><div class="im">+        if (<a href="http://IFI.TD" target="_blank">IFI.TD</a> != 0) {<br>
+          uint64_t SizeValue = AllocaArraySize->getLimitedValue();<br>
+          Type *AllocaType = AI->getAllocatedType();<br>
</div>----------------<br>
<div class="im">Nick Lewycky wrote:<br>
> 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?<br>
</div>Done<br>
<div class="im"><br>
================<br>
Comment at: lib/Transforms/Utils/InlineFunction.cpp:678<br>
@@ +677,3 @@<br>
</div><div class="im">+          Type *AllocaType = AI->getAllocatedType();<br>
+          SizeValue *= IFI.TD->getTypeAllocSize(AllocaType);<br>
+          AllocaSize = ConstantInt::get(Type::getInt64Ty(AI->getContext()),<br>
</div>----------------<br>
<div class="im">Nick Lewycky wrote:<br>
> What about overflow here?<br>
><br>
> 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.<br>
><br>
</div>Done<br>
<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D110" target="_blank">http://llvm-reviews.chandlerc.com/D110</a><br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div></div>