[InstSimplify] add tests for or-of-icmps; NFC
authorSanjay Patel <spatel@rotateright.com>
Sun, 31 Jul 2022 21:42:58 +0000 (17:42 -0400)
committerSanjay Patel <spatel@rotateright.com>
Thu, 4 Aug 2022 18:54:52 +0000 (14:54 -0400)
llvm/test/Transforms/InstSimplify/and-icmps-same-ops.ll
llvm/test/Transforms/InstSimplify/or-icmps-same-ops.ll

index 25b8b78..a92a3bc 100644 (file)
@@ -1234,4 +1234,3 @@ define i1 @ult_ult_swap(i8 %a, i8 %b) {
   %and = and i1 %cmp1, %cmp2
   ret i1 %and
 }
-
index 3dfef79..d1bcb9d 100644 (file)
@@ -1233,3 +1233,15 @@ define i1 @ult_ule_swap(i8 %a, i8 %b) {
   ret i1 %or
 }
 
+define i1 @ule_ule_swap(i8 %a, i8 %b) {
+; CHECK-LABEL: @ule_ule_swap(
+; CHECK-NEXT:    [[CMP1:%.*]] = icmp ule i8 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT:    [[CMP2:%.*]] = icmp ule i8 [[B]], [[A]]
+; CHECK-NEXT:    [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
+; CHECK-NEXT:    ret i1 [[OR]]
+;
+  %cmp1 = icmp ule i8 %a, %b
+  %cmp2 = icmp ule i8 %b, %a
+  %or = or i1 %cmp1, %cmp2
+  ret i1 %or
+}