[PATCH] D34273: [SCEV] Use depth limit instead of local cache for SExt and ZExt

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 18:51:45 PDT 2017


To control the size of the cache, why not just LRU it instead?
Limiting recursion depth seems like a really big hammer to use here.
Is there really no better way?



On Fri, Jun 16, 2017 at 5:02 AM, Max Kazantsev via Phabricator via
llvm-commits <llvm-commits at lists.llvm.org> wrote:

> mkazantsev created this revision.
> Herald added a subscriber: mzolotukhin.
>
> In https://reviews.llvm.org/rL300494 there was an attempt to deal with
> excessive compile time on
> invocations of getSign/ZeroExtExpr using local caching. This approach only
> helps if we request the same SCEV multiple times throughout recursion. But
> in the bug PR33431 we see a case where we request different values all the
> time,
> so caching does not help and the size of the cache grows enormously.
>
> In this patch we remove the local cache for this methods and add the
> recursion
> depth limit instead, as we do for arithmetics. This gives us a guarantee
> that the
> invocation sequence is limited and reasonably short.
>
>
> https://reviews.llvm.org/D34273
>
> Files:
>   include/llvm/Analysis/ScalarEvolution.h
>   lib/Analysis/ScalarEvolution.cpp
>   lib/Transforms/Utils/SimplifyIndVar.cpp
>   test/Analysis/ScalarEvolution/limit-depth.ll
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170621/d4492aec/attachment.html>


More information about the llvm-commits mailing list