summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/saturating-add-sub.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstCombine/saturating-add-sub.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/saturating-add-sub.ll16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/test/Transforms/InstCombine/saturating-add-sub.ll b/llvm/test/Transforms/InstCombine/saturating-add-sub.ll
index 96848629438..17c0d958838 100644
--- a/llvm/test/Transforms/InstCombine/saturating-add-sub.ll
+++ b/llvm/test/Transforms/InstCombine/saturating-add-sub.ll
@@ -672,11 +672,10 @@ define i32 @uadd_sat_commute_add(i32 %xp, i32 %y) {
define i32 @uadd_sat_ugt(i32 %x, i32 %yp) {
; CHECK-LABEL: @uadd_sat_ugt(
; CHECK-NEXT: [[Y:%.*]] = sdiv i32 [[YP:%.*]], 2442
-; CHECK-NEXT: [[NOTX:%.*]] = xor i32 [[X:%.*]], -1
-; CHECK-NEXT: [[A:%.*]] = add i32 [[Y]], [[X]]
-; CHECK-NEXT: [[C:%.*]] = icmp ugt i32 [[Y]], [[NOTX]]
-; CHECK-NEXT: [[R:%.*]] = select i1 [[C]], i32 -1, i32 [[A]]
-; CHECK-NEXT: ret i32 [[R]]
+; CHECK-NEXT: [[A:%.*]] = add i32 [[Y]], [[X:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[A]], [[Y]]
+; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[TMP1]], i32 -1, i32 [[A]]
+; CHECK-NEXT: ret i32 [[TMP2]]
;
%y = sdiv i32 %yp, 2442 ; thwart complexity-based-canonicalization
%notx = xor i32 %x, -1
@@ -690,11 +689,10 @@ define i32 @uadd_sat_ugt_commute_add(i32 %xp, i32 %yp) {
; CHECK-LABEL: @uadd_sat_ugt_commute_add(
; CHECK-NEXT: [[Y:%.*]] = sdiv i32 [[YP:%.*]], 2442
; CHECK-NEXT: [[X:%.*]] = srem i32 42, [[XP:%.*]]
-; CHECK-NEXT: [[NOTX:%.*]] = xor i32 [[X]], -1
; CHECK-NEXT: [[A:%.*]] = add i32 [[X]], [[Y]]
-; CHECK-NEXT: [[C:%.*]] = icmp ugt i32 [[Y]], [[NOTX]]
-; CHECK-NEXT: [[R:%.*]] = select i1 [[C]], i32 -1, i32 [[A]]
-; CHECK-NEXT: ret i32 [[R]]
+; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[A]], [[Y]]
+; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[TMP1]], i32 -1, i32 [[A]]
+; CHECK-NEXT: ret i32 [[TMP2]]
;
%y = sdiv i32 %yp, 2442 ; thwart complexity-based-canonicalization
%x = srem i32 42, %xp ; thwart complexity-based-canonicalization
OpenPOWER on IntegriCloud