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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 05:02:04 PDT 2017


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34273.102804.patch
Type: text/x-patch
Size: 28128 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170616/21890be0/attachment.bin>


More information about the llvm-commits mailing list