[llvm] 9a5b34b - [InstSimplify] add tests for or-of-icmps; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 12:00:28 PDT 2022


Author: Sanjay Patel
Date: 2022-08-04T14:54:52-04:00
New Revision: 9a5b34be157dd95816f5134eecd7fbe7d7e42d63

URL: https://github.com/llvm/llvm-project/commit/9a5b34be157dd95816f5134eecd7fbe7d7e42d63
DIFF: https://github.com/llvm/llvm-project/commit/9a5b34be157dd95816f5134eecd7fbe7d7e42d63.diff

LOG: [InstSimplify] add tests for or-of-icmps; NFC

Added: 
    

Modified: 
    llvm/test/Transforms/InstSimplify/and-icmps-same-ops.ll
    llvm/test/Transforms/InstSimplify/or-icmps-same-ops.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstSimplify/and-icmps-same-ops.ll b/llvm/test/Transforms/InstSimplify/and-icmps-same-ops.ll
index 25b8b78c7db07..a92a3bc52105c 100644
--- a/llvm/test/Transforms/InstSimplify/and-icmps-same-ops.ll
+++ b/llvm/test/Transforms/InstSimplify/and-icmps-same-ops.ll
@@ -1234,4 +1234,3 @@ define i1 @ult_ult_swap(i8 %a, i8 %b) {
   %and = and i1 %cmp1, %cmp2
   ret i1 %and
 }
-

diff  --git a/llvm/test/Transforms/InstSimplify/or-icmps-same-ops.ll b/llvm/test/Transforms/InstSimplify/or-icmps-same-ops.ll
index 3dfef79c450c4..d1bcb9d0ece0a 100644
--- a/llvm/test/Transforms/InstSimplify/or-icmps-same-ops.ll
+++ b/llvm/test/Transforms/InstSimplify/or-icmps-same-ops.ll
@@ -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
+}


        


More information about the llvm-commits mailing list