[PATCH] [asan] Speed up interesting alloca checks

Chandler Carruth chandlerc at google.com
Thu Mar 26 14:33:30 PDT 2015


On Thu, Mar 26, 2015 at 2:17 PM, Kostya Serebryany <kcc at google.com> wrote:

> In http://reviews.llvm.org/D8639#147540, @zaks.anna wrote:
>
> > > This looks fine, but I would slightly prefer to compute the map
> beforehand instead of caching, if possible.
> >
> > >  I.e. instead of a map of ProcessedAllocas have a set of
> InterestingAllocas that is computed in visitAllocaInst
> >
> >
> > In the future, determining if an alloca is interesting or not might
> depend on visiting all of its uses. For example, if an alloca is promotable
> but all of it's uses are accessing memory, which is provably in range, it
> should be marked as non-interesting. The current approach seems to fit that
> model better than visiting allocas and building a list.
>
>
> But you can also visit all uses in a pre-compute step too.
> And having this pre-computed instead of cached will make the code simpler
> to understand.


Each walk of the use list of the alloca is relatively expensive -- it is a
linked list and cache hostile.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150326/f3ee63f9/attachment.html>


More information about the llvm-commits mailing list