summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-08-19 15:21:45 +0000
committerSanjay Patel <spatel@rotateright.com>2016-08-19 15:21:45 +0000
commit14cdf1968f0fc5463799c234a21876f6c5434345 (patch)
tree74b9a52b40ad886a2a5b53ba80699c0d5fd2e43d /llvm
parentdb24d9c3e8423d6e9a8ddda3d7ad3dea204e0429 (diff)
downloadbcm5719-llvm-14cdf1968f0fc5463799c234a21876f6c5434345.tar.gz
bcm5719-llvm-14cdf1968f0fc5463799c234a21876f6c5434345.zip
[InstCombine] add missing tests for basic icmp folds
These are implicitly included as part of larger test cases, but they don't exist stand-alone (and don't happen for vectors...). llvm-svn: 279257
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/Transforms/InstCombine/icmp.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll
index b1f5e501f02..2d2dfb51e39 100644
--- a/llvm/test/Transforms/InstCombine/icmp.ll
+++ b/llvm/test/Transforms/InstCombine/icmp.ll
@@ -2581,3 +2581,22 @@ define i1 @PR27792_2(i128 %a) {
ret i1 %b
}
+define i1 @ugtMaxSignedVal(i8 %a) {
+; CHECK-LABEL: @ugtMaxSignedVal(
+; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 %a, 0
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %cmp = icmp ugt i8 %a, 127
+ ret i1 %cmp
+}
+
+define i1 @ugtKnownBits(i8 %a) {
+; CHECK-LABEL: @ugtKnownBits(
+; CHECK-NEXT: [[B:%.*]] = and i8 %a, 17
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[B]], 17
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %b = and i8 %a, 17
+ %cmp = icmp ugt i8 %b, 16
+ ret i1 %cmp
+}
OpenPOWER on IntegriCloud