[llvm] [InstCombine] Add Missed Optimization (PR #141962)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 31 11:41:54 PDT 2025


nikic wrote:

> As I commented in [#141479 (comment)](https://github.com/llvm/llvm-project/issues/141479#issuecomment-2911154459), both LHS and RHS are uadd-overflow check idiom. I am not sure if it is profitable to canonicalize them into `extractvalue uadd.overflow(x, y), 1`. If not, we can add a helper function to recognize such overflow-checking patterns.

We have m_UAddWithOverflow() for this. It does match the `x < ~y` pattern as well. But it doesn't match the negated overflow check.

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


More information about the llvm-commits mailing list