[llvm] [IndVarSimplify] Do not replace ExitValue if it contains Udiv with non-constant divisor (PR #109945)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 00:53:49 PDT 2024


ShivaChen wrote:

> If SCEV could determine a small max trip count for the loop, we could take that into account when deciding whether to expand or not, but I doubt that it can in this case.

Yes, the case can't be determined the trip count.

> For this change, I'm concerned that you are optimizing the code for one specific benchmark, but will make things worse for other cases.

As nikic suggested, guarding the replacement should only benefit for small trip count. 

https://github.com/llvm/llvm-project/pull/109945


More information about the llvm-commits mailing list