[llvm] [InstCombine] Pattern match minmax calls for unsigned saturation. (PR #99250)

Huihui Zhang via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 16:01:55 PDT 2024


huihzhang wrote:

Thanks @dtcxzyw @goldsteinn for the feedbacks! 
I will post an update, and simplify into below pattern match rules:
1. fold smax(UINT_MIN, sub(zext(A), zext(B))) into usub_sat,
2. fold umin(UINT_MAX, add(zext(A), zext(B))) into uadd_sat.

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


More information about the llvm-commits mailing list