[llvm] [InstCombine] Improve handling of `not` and free inversion. (PR #66787)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 20 09:17:59 PST 2023


nikic wrote:

> > LGTM with the last commit removed (the test coverage is quite insufficient around m_AddSubInvertable, and I don't particularly want this fold anyway).
> 
> I'd be happy to improve the coverage. Why are you opposed to the commit as a whole? Also do you mean removed entirely, or is changing is to `ConsumeLHS && ConsumeRHS` okay?

It looks like a fold with very low value but very high risk. Limiting it to `ConsumeLHS && ConsumeRHS` (with `&&`, not `||`, and no special add/sub cases) would probably be acceptable.

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


More information about the llvm-commits mailing list