[PATCH] D46039: Fix compile time hang in LSR

Evgeny Stupachenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 24 19:55:09 PDT 2018


evstupac added a comment.

In https://reviews.llvm.org/D46039#1077621, @mkazantsev wrote:

> Could you please explain what is the problem? I cannot make it out from the test, it's too big. Can it be reduced?


Problem is in the test compile time. You can download it and try.
The reason of the compile time hang is too many reasociations in LSR.
Now reassociations lookup is bounded only by Depth. If there are reasonable amount of reassociations on each level ~16,
 the whole number would not exceed ~16^3 which is ok.
However if number of reassociations itself is very big (~256 in this test) it could grow to ~256^3 which is unacceptable.
In the patch I'm trying to introduce some universal bound which will take in account both depth and number of reassociations and not hurt current performance s generally number of reassociations is <16.


Repository:
  rL LLVM

https://reviews.llvm.org/D46039





More information about the llvm-commits mailing list