[PATCH] D149529: [SCEV][reland] More precise trip multiples

Joshua Cao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 23:15:04 PDT 2023


caojoshua added a comment.

In D149529#4320986 <https://reviews.llvm.org/D149529#4320986>, @mkazantsev wrote:

> Do we know if we can forget smth when strenghtening flags without harming the compile time to get the more precise resutlt in these cases?

In this patch we forget it specifically for getRecAddExpr's, which accounts for most use cases and should not be expensive. For other less common use cases, forgetting would be too expensive. In the example I have above:

An interesting non-SCEVAddRecExpr case that failures the verification is IndVarSimplify/udiv.ll. In verification, we try to compute the multiple of (8193 smax {6,+,3}<nuw><%for.body15>), which is 3. When originally caching the value for the SCEV, we had (8193 smax {6,+,3}<%for.body15>), which due to the lack of nuw, has a multiple of 1.

> 

When we add the addition, we would need to forget the addition and all uses of the addition as well, which is the smax in this case. In worse case, there can be long chains of SCEV users that would need to be forgotten. I'd say its too compile-time expensive for very little benefit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149529



More information about the llvm-commits mailing list