[llvm] [InstCombine] Fold (sub nsw X, umin(X, C)) s< C2 to (X s< C + C2) (PR #170422)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 11 06:30:17 PST 2026
dtcxzyw wrote:
> @dtcxzyw Should this patch be changed to utilize range?
No. I'd like to match the exact expression `(sub nsw X, umin(X, C)) s< C2` and ignore the canonicalization to usub.sat. The IR diff in https://github.com/llvm/llvm-project/pull/170989 showed that umin is likely to have multiple uses. You can also check other existences reported by https://github.com/dtcxzyw/llvm-opt-benchmark/issues/3321.
https://github.com/llvm/llvm-project/pull/170422
More information about the llvm-commits
mailing list