]> granicus.if.org Git - llvm/commitdiff
[NFC][InstCombine] Fixup commutative/negative tests with icmp preds in @llvm.umul...
authorRoman Lebedev <lebedev.ri@gmail.com>
Tue, 23 Jul 2019 12:42:57 +0000 (12:42 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Tue, 23 Jul 2019 12:42:57 +0000 (12:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366802 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/unsigned-mul-lack-of-overflow-check-via-udiv-of-allones.ll
test/Transforms/InstCombine/unsigned-mul-overflow-check-via-udiv-of-allones.ll

index 2865dfafd51e957cfe40ae47a3764aee3243ee62..314ab09024f382b417956207b59560d6f59ea46e 100644 (file)
@@ -45,12 +45,12 @@ define i1 @t3_commutative(i8 %x) {
 ; CHECK-LABEL: @t3_commutative(
 ; CHECK-NEXT:    [[T0:%.*]] = udiv i8 -1, [[X:%.*]]
 ; CHECK-NEXT:    [[Y:%.*]] = call i8 @gen8()
-; CHECK-NEXT:    [[R:%.*]] = icmp ult i8 [[Y]], [[T0]]
+; CHECK-NEXT:    [[R:%.*]] = icmp ule i8 [[Y]], [[T0]]
 ; CHECK-NEXT:    ret i1 [[R]]
 ;
   %t0 = udiv i8 -1, %x
   %y = call i8 @gen8()
-  %r = icmp ult i8 %y, %t0 ; swapped
+  %r = icmp ule i8 %y, %t0 ; swapped
   ret i1 %r
 }
 
@@ -89,19 +89,17 @@ define i1 @n6_wrong_pred0(i8 %x, i8 %y) {
 ; CHECK-NEXT:    ret i1 [[R]]
 ;
   %t0 = udiv i8 -1, %x
-  %r = icmp ule i8 %t0, %y
+  %r = icmp ule i8 %t0, %y ; not uge
   ret i1 %r
 }
 
-define i1 @n6_wrong_pred1(i8 %x) {
+define i1 @n6_wrong_pred1(i8 %x, i8 %y) {
 ; CHECK-LABEL: @n6_wrong_pred1(
 ; CHECK-NEXT:    [[T0:%.*]] = udiv i8 -1, [[X:%.*]]
-; CHECK-NEXT:    [[Y:%.*]] = call i8 @gen8()
-; CHECK-NEXT:    [[R:%.*]] = icmp ugt i8 [[Y]], [[T0]]
+; CHECK-NEXT:    [[R:%.*]] = icmp ugt i8 [[T0]], [[Y:%.*]]
 ; CHECK-NEXT:    ret i1 [[R]]
 ;
   %t0 = udiv i8 -1, %x
-  %y = call i8 @gen8()
-  %r = icmp ugt i8 %y, %t0 ; swapped
+  %r = icmp ugt i8 %t0, %y ; not uge
   ret i1 %r
 }
index d66f5f7c40ab96de6535448be4d0d648d4385929..4a555cbefee927d9cec3f3b08b31c6f519e65362 100644 (file)
@@ -45,12 +45,12 @@ define i1 @t3_commutative(i8 %x) {
 ; CHECK-LABEL: @t3_commutative(
 ; CHECK-NEXT:    [[T0:%.*]] = udiv i8 -1, [[X:%.*]]
 ; CHECK-NEXT:    [[Y:%.*]] = call i8 @gen8()
-; CHECK-NEXT:    [[R:%.*]] = icmp uge i8 [[Y]], [[T0]]
+; CHECK-NEXT:    [[R:%.*]] = icmp ugt i8 [[Y]], [[T0]]
 ; CHECK-NEXT:    ret i1 [[R]]
 ;
   %t0 = udiv i8 -1, %x
   %y = call i8 @gen8()
-  %r = icmp uge i8 %y, %t0 ; swapped
+  %r = icmp ugt i8 %y, %t0 ; swapped
   ret i1 %r
 }
 
@@ -89,7 +89,7 @@ define i1 @n6_wrong_pred0(i8 %x, i8 %y) {
 ; CHECK-NEXT:    ret i1 [[R]]
 ;
   %t0 = udiv i8 -1, %x
-  %r = icmp ule i8 %t0, %y
+  %r = icmp ule i8 %t0, %y ; not ult
   ret i1 %r
 }
 
@@ -100,6 +100,6 @@ define i1 @n6_wrong_pred1(i8 %x, i8 %y) {
 ; CHECK-NEXT:    ret i1 [[R]]
 ;
   %t0 = udiv i8 -1, %x
-  %r = icmp ugt i8 %t0, %y
+  %r = icmp ugt i8 %t0, %y ; not ult
   ret i1 %r
 }