[llvm] r366802 - [NFC][InstCombine] Fixup commutative/negative tests with icmp preds in @llvm.umul.with.overflow tests

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 05:42:57 PDT 2019


Author: lebedevri
Date: Tue Jul 23 05:42:57 2019
New Revision: 366802

URL: http://llvm.org/viewvc/llvm-project?rev=366802&view=rev
Log:
[NFC][InstCombine] Fixup commutative/negative tests with icmp preds in @llvm.umul.with.overflow tests

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

Modified: llvm/trunk/test/Transforms/InstCombine/unsigned-mul-lack-of-overflow-check-via-udiv-of-allones.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/unsigned-mul-lack-of-overflow-check-via-udiv-of-allones.ll?rev=366802&r1=366801&r2=366802&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/unsigned-mul-lack-of-overflow-check-via-udiv-of-allones.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/unsigned-mul-lack-of-overflow-check-via-udiv-of-allones.ll Tue Jul 23 05:42:57 2019
@@ -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
 }

Modified: llvm/trunk/test/Transforms/InstCombine/unsigned-mul-overflow-check-via-udiv-of-allones.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/unsigned-mul-overflow-check-via-udiv-of-allones.ll?rev=366802&r1=366801&r2=366802&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/unsigned-mul-overflow-check-via-udiv-of-allones.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/unsigned-mul-overflow-check-via-udiv-of-allones.ll Tue Jul 23 05:42:57 2019
@@ -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
 }




More information about the llvm-commits mailing list