[llvm] [ValueTracking] Infer `X u<= X +nuw Y` for any Y (PR #75524)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 14 12:15:42 PST 2023
================
@@ -321,9 +321,7 @@ define i1 @pr70374(i32 %x, i32 %y, i32 %z) {
; CHECK-LABEL: @pr70374(
; CHECK-NEXT: [[ADD:%.*]] = add nuw i32 [[Y:%.*]], [[Z:%.*]]
; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i32 [[ADD]], [[X:%.*]]
-; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X]], [[Y]]
-; CHECK-NEXT: [[RES:%.*]] = and i1 [[CMP2]], [[CMP1]]
-; CHECK-NEXT: ret i1 [[RES]]
+; CHECK-NEXT: ret i1 [[CMP1]]
;
%add = add nuw i32 %y, %z
----------------
nikic wrote:
Add test for commuted add operands?
https://github.com/llvm/llvm-project/pull/75524
More information about the llvm-commits
mailing list