[llvm] [InstCombine] fold icmp of select with constants and invertible op (PR #147182)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 9 06:09:09 PDT 2025


nikic wrote:

> > We can simply extend `foldICmpEqualityWithOffset` to handle the motivating case.
> 
> Do we need to keep the optimization for ucmp/scmp?

I think it should be possible to generalize that fold to handle unsigned/signed predicate as well (just changes which ops can be applied).

But probably it makes sense to start with just the equality case.

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


More information about the llvm-commits mailing list