From 9a5b34be157dd95816f5134eecd7fbe7d7e42d63 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Sun, 31 Jul 2022 17:42:58 -0400 Subject: [PATCH] [InstSimplify] add tests for or-of-icmps; NFC --- llvm/test/Transforms/InstSimplify/and-icmps-same-ops.ll | 1 - llvm/test/Transforms/InstSimplify/or-icmps-same-ops.ll | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/llvm/test/Transforms/InstSimplify/and-icmps-same-ops.ll b/llvm/test/Transforms/InstSimplify/and-icmps-same-ops.ll index 25b8b78..a92a3bc 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 3dfef79..d1bcb9d 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 +} -- 2.7.4