[llvm] [InstCombine] Detect uadd with overflow idiom (PR #140178)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 6 20:35:24 PDT 2025
================
@@ -2350,4 +2350,57 @@ define i8 @fold_add_umax_to_usub_multiuse(i8 %a) {
ret i8 %sel
}
+define i32 @uadd_with_zext(i32 %x, i32 %y) {
+; CHECK-LABEL: @uadd_with_zext(
+; CHECK-NEXT: [[COND:%.*]] = call i32 @llvm.uadd.sat.i32(i32 [[X:%.*]], i32 [[Y:%.*]])
+; CHECK-NEXT: ret i32 [[COND]]
+;
----------------
AZero13 wrote:
Well, that's how instcombine is folding it.
What I do only generates the add and compare.
Other folds are folding it further that I don't have any part of
https://github.com/llvm/llvm-project/pull/140178
More information about the llvm-commits
mailing list