[llvm] [SimplifyIndVar] ICMP predicate conversion to EQ/NE (PR #144945)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 2 15:09:37 PST 2025


preames wrote:

For future reference, after applying a local fix to avoid setting samesign on equalities, and manually filtering out the improvements from setting samesign on strictly negative operands, I've manually gone through the remainder of the test differences included in the review.  It's not clear there's much value demonstrated, in particular, the majority of the tests *do* involve loop exits, and are thus candidates for LFTR.  Several of the test updates appear unlikely to be correct.  

@SergeyShch01 - I would suggest rebasing after https://github.com/llvm/llvm-project/pull/170363 has landed.  I want to be clear that I am skeptical that this patch will ever land.  This is not simply a case of fixing a few small things; the problem is with the approach and the fact that you're proposing duplicating some extremely complicated and risky code.  We're not going to do that without compelling reason, and I don't see the examples in tests to be motivating.  

On your motivating C example, can you explain what you actual goal is?  I can confirm that your patch converts one of signed compare to an equality, but what are you actually hoping to unblock here?  You mention computing a trip count, but the loop seems to be unanalyzable both with and without your patch?  

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


More information about the llvm-commits mailing list