[PATCH] [asan] Speed up interesting alloca checks

Anna Zaks zaks.anna at gmail.com
Thu Mar 26 16:20:56 PDT 2015


Given what we do now, we would walk the uses the same number of times.
However:

1) We currently do not run an instruction visitor in the very beginning of
the pass (before instrumenting memory acceses). So we would either need to
walk instructions or possibly move FunctionStackPoisoner to run in the very
beginning (not sure if that is possible).
2) When we are at the point where we look only at provably safe memory
accesses, we could just mark allocas as interesting as we are walking the
memory operations and deciding which ones to instrument. There would be no
need to look at uses twice in that case. (I guess, there is no need for
that now either other than I'd prefer to just call the existing
isAllocaPromotable rather than migrating that functionality into the ASan
pass.)

On Thu, Mar 26, 2015 at 3:44 PM, Chandler Carruth <chandlerc at google.com>
wrote:

>
> On Thu, Mar 26, 2015 at 3:34 PM, Kostya Serebryany <kcc at google.com> wrote:
>
>> > > Each walk of the use list of the alloca is relatively expensive -- it
>> is a linked list and cache hostile.
>>
>> >
>>
>>
>> But won't we need it anyway regardless of caching-cs-precomputing?
>
>
> Yes, what I'm saying is that reducing the number of times you walk the use
> list is relevant. It's a locality optimization. Where possible, it is good
> to try to do as much work as possible during a single use-list traversal
> rather than to traverse every alloca instructions' use list multiple times
> for the multiple things you might need to do.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150326/0062921a/attachment.html>


More information about the llvm-commits mailing list