[llvm] c00cab8 - [InstCombine] add test for or-of-icmps; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 10 08:08:06 PDT 2021
Author: Sanjay Patel
Date: 2021-10-10T11:06:49-04:00
New Revision: c00cab878aa523e20a5dbd618e9852e191504cfe
URL: https://github.com/llvm/llvm-project/commit/c00cab878aa523e20a5dbd618e9852e191504cfe
DIFF: https://github.com/llvm/llvm-project/commit/c00cab878aa523e20a5dbd618e9852e191504cfe.diff
LOG: [InstCombine] add test for or-of-icmps; NFC
Added:
Modified:
llvm/test/Transforms/InstCombine/or.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/or.ll b/llvm/test/Transforms/InstCombine/or.ll
index b4c5719f47026..90f4f45935353 100644
--- a/llvm/test/Transforms/InstCombine/or.ll
+++ b/llvm/test/Transforms/InstCombine/or.ll
@@ -1444,3 +1444,18 @@ define i8 @lshr_bitwidth_mask(i8 %x, i8 %y) {
%r = or i8 %sign, %y
ret i8 %r
}
+
+define i1 @cmp_overlap(i32 %x) {
+; CHECK-LABEL: @cmp_overlap(
+; CHECK-NEXT: [[ISNEG:%.*]] = icmp slt i32 [[X:%.*]], 0
+; CHECK-NEXT: [[NEGX:%.*]] = sub i32 0, [[X]]
+; CHECK-NEXT: [[ISNOTNEG:%.*]] = icmp sgt i32 [[NEGX]], -1
+; CHECK-NEXT: [[R:%.*]] = or i1 [[ISNEG]], [[ISNOTNEG]]
+; CHECK-NEXT: ret i1 [[R]]
+;
+ %isneg = icmp slt i32 %x, 0
+ %negx = sub i32 0, %x
+ %isnotneg = icmp sgt i32 %negx, -1
+ %r = or i1 %isneg, %isnotneg
+ ret i1 %r
+}
More information about the llvm-commits
mailing list