Hi Ott. <div>In general, I like your patch and the whole idea to use an existing LLVM analysis pass to optimize away redundant asan checks. </div><div>Please also send your performance and compile-time numbers here -- they look nice. </div>
<div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 9, 2012 at 3:13 PM, Ott Tinn <span dir="ltr"><<a href="mailto:llvm@otinn.com" target="_blank">llvm@otinn.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hi,<br>
<br>
The attached patches add an optimization to ASan that makes it avoid<br>
adding run-time checks to memory accesses that are always in bounds of<br>
valid (not deallocated) memory objects. The current version works on<br>
simple allocas, global variables, and byval arguments using the<br>
ScalarEvolution analysis.<br>
<br>
The included lit tests should work without the Clang patch but some of<br>
the existing ASan tests would fail without it.<br>
<br>
The ScalarEvolution and DataLayout complications seem to be caused by<br>
a module pass (AddressSanitizer) requiring a function pass<br>
(ScalarEvolution) which in turn wants to use an immutable pass<br>
(DataLayout).<br></blockquote><div><br></div><div>Let's resolve this problem first. </div><div>Will it help if we make AddressSanitizer to be a FunctionPass? </div><div>I remember Chandler asking to do that, but don't remember the motivation (other than "good for future parallelization")</div>
<div>(AddressSanitizer is currently a ModulePass for historical reasons, ThreadSanitizer is already a FunctionPass).</div><div>If converting AddressSanitizer to a FunctionPass will simplify this patch, let's do it separately (I can do it myself, but only on the next week). </div>
<div><br></div><div>--kcc </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
Rietveld review link: <a href="http://codereview.appspot.com/6633047/#ps1" target="_blank">http://codereview.appspot.com/6633047/#ps1</a><br>
</blockquote></div><br></div>