[PATCH] D104679: [LoopUnrolling] Add flag to restrict the unroll with large loop size

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 22 02:12:37 PDT 2021


Allen added a comment.

In D104679#2832502 <https://reviews.llvm.org/D104679#2832502>, @nikic wrote:

> Skipping very large loops might make sense as a compile-time optimization (don't bother analyzing loops that definitely can't be unrolled), but I don't think it's a solution to a stack overflow in SCEV. It can happen through other ways than loop unrolling. SCEV uses recursive construction and stack overflows are a known issue -- it deals with them through various depth cutoffs. Maybe one is missing somewhere?

Yes, if a case unroll the loops manually may also happen such issue. the root reason is too many node to dispose SCEV
in this case, the recursive call between createSCEV and getSCEV, and both them don't have a depth cutoffs now. So need a cutoff in createSCEV ?


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

https://reviews.llvm.org/D104679



More information about the llvm-commits mailing list