[PATCH] D111066: Disable "[SCEV] Prove implications of different type via truncation"

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 02:17:24 PDT 2021


fhahn added a comment.

In D111066#3041655 <https://reviews.llvm.org/D111066#3041655>, @mkazantsev wrote:

> This patch is one year old. It is extremely surprising that you are trying to disable it rather than find the root cause.
>
> I don't believe this is infinite recursion. Before all, infinite recursion should end up with stack overflow and not timeout. I can believe there is some exponential explosion happening, but in this case you need to find how exactly it happens and fix the acutal reason. The fact that this patch triggers something very slow doesn't convince me that this patch is guilty, and this test doesn't allow to figure it out easily.
>
> Could you please check (at least, but not limited to):
>
> - Do we end up creating some HUGE SCEVs in your test?
> - Do we end up making the same implication query millions of times?
> - Do we end up walking huge dom trees for execution of some queries?
>
> Before we decide to switch something off, I want to know why exactly.

I added a smaller (~500 lines) reproducer that takes ~15s on my machine on `main`: https://bugs.llvm.org/attachment.cgi?id=25328. With D111066 <https://reviews.llvm.org/D111066> it goes down to 0.2s, which I think clearly shows that . So it's not an infinite loop but a compile-time explosion with ~60% of compile-time spent in evaluatePredicateAt, ~25% in getStrengthenedNoWrapFlagsFromBinOp and ~10% in getSCEV.

It looks related to the depth of chained basic blocks. The reproducer has a lot of basic block chained together with unconditional branches. I already removed a lot of similar chains to bring down the compile-time.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111066



More information about the llvm-commits mailing list