[llvm-commits] [PATCH] Add a known bounds optimization to ASan

Kostya Serebryany kcc at google.com
Tue Oct 9 04:28:35 PDT 2012


Hi Ott.
In general, I like your patch and the whole idea to use an existing LLVM
analysis pass to optimize away redundant asan checks.
Please also send your performance and compile-time numbers here -- they
look nice.


On Tue, Oct 9, 2012 at 3:13 PM, Ott Tinn <llvm at otinn.com> wrote:

> Hi,
>
> The attached patches add an optimization to ASan that makes it avoid
> adding run-time checks to memory accesses that are always in bounds of
> valid (not deallocated) memory objects. The current version works on
> simple allocas, global variables, and byval arguments using the
> ScalarEvolution analysis.
>
> The included lit tests should work without the Clang patch but some of
> the existing ASan tests would fail without it.
>
> The ScalarEvolution and DataLayout complications seem to be caused by
> a module pass (AddressSanitizer) requiring a function pass
> (ScalarEvolution) which in turn wants to use an immutable pass
> (DataLayout).
>

Let's resolve this problem first.
Will it help if we make AddressSanitizer to be a FunctionPass?
I remember Chandler asking to do that, but don't remember the motivation
(other than "good for future parallelization")
(AddressSanitizer is currently a ModulePass for historical reasons,
ThreadSanitizer is already a FunctionPass).
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).

--kcc



>
> Rietveld review link: http://codereview.appspot.com/6633047/#ps1
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121009/c19100ae/attachment.html>


More information about the llvm-commits mailing list