[llvm] [IndVarSimplify] Introduce `simulateFPIVTripCount` to canonicalize fp loops (PR #169707)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 26 20:09:43 PST 2025


https://github.com/dtcxzyw requested changes to this pull request.

I don't think this is necessary because we have a symbolic brute-force trip count evaluator in `getConstantEvolutionLoopExitValue`. With `-mllvm --scalar-evolution-max-iterations=1000` clang will fold the trip count to 999. If the comptime overhead is acceptable, we can increase the threshold to align with GCC.

Can we solve the trip count in `O(lg(abs(exit-init)/abs(incr)))`? We can use binary search since it is monotonic. I am not sure if it works.



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


More information about the llvm-commits mailing list