[PATCH] D114650: [SCEV] Construct SCEV iteratively (WIP).

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 29 03:01:19 PST 2021


fhahn added a comment.

>>>! In D114650#3157263 <https://reviews.llvm.org/D114650#3157263>, @lebedev.ri wrote:

>> In D114650#3157253 <https://reviews.llvm.org/D114650#3157253>, @nikic wrote:
>>
>>> To ask the obvious question: Can we get away with simply adding a getSCEV recursion limit instead? Is there reason to believe that a sensible recursion cutoff (similar to the many SCEV already has) would adversely affect analysis quality in practice? I'd rather avoid the additional complexity if we can.
>>
>> Recursion itself is rarely the right solution in the first place, let alone working around it by introducing random cut-offs.
>
> I think one issue with a cut-off for the recursion is that such a cut-off would make SCEV instantiations depend on the instantiation order. I am not sure how much this would be an issue in practice, but among other things it may make verification of SCEV harder (e.g.  if we compute SCEVs from scratch to the cached version we would have to make sure to use the same evaluation order as when computing the original SCEV).

https://bugs.llvm.org/show_bug.cgi?id=32731 has a bit more discussion/context on the potential issues of a cut-off.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114650/new/

https://reviews.llvm.org/D114650



More information about the llvm-commits mailing list