summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-08-19 15:27:28 +0000
committerSanjay Patel <spatel@rotateright.com>2016-08-19 15:27:28 +0000
commit78111a76173e798ccb25746d41329536616a2215 (patch)
treeda57fc3d160448d377ca0026ad0a80b3970d1a45 /llvm/test/Transforms/InstCombine
parent03e0560da77f47bdb70947efce7b8639d0f77f0d (diff)
downloadbcm5719-llvm-78111a76173e798ccb25746d41329536616a2215.tar.gz
bcm5719-llvm-78111a76173e798ccb25746d41329536616a2215.zip
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 279259
Diffstat (limited to 'llvm/test/Transforms/InstCombine')
-rw-r--r--llvm/test/Transforms/InstCombine/icmp.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll
index 2d2dfb51e39..7aae75bc459 100644
--- a/llvm/test/Transforms/InstCombine/icmp.ll
+++ b/llvm/test/Transforms/InstCombine/icmp.ll
@@ -2590,6 +2590,11 @@ define i1 @ugtMaxSignedVal(i8 %a) {
ret i1 %cmp
}
+define <2 x i1> @ugtMaxSignedValVec(<2 x i8> %a) {
+ %cmp = icmp ugt <2 x i8> %a, <i8 127, i8 127>
+ ret <2 x i1> %cmp
+}
+
define i1 @ugtKnownBits(i8 %a) {
; CHECK-LABEL: @ugtKnownBits(
; CHECK-NEXT: [[B:%.*]] = and i8 %a, 17
@@ -2600,3 +2605,15 @@ define i1 @ugtKnownBits(i8 %a) {
%cmp = icmp ugt i8 %b, 16
ret i1 %cmp
}
+
+define <2 x i1> @ugtKnownBitsVec(<2 x i8> %a) {
+; CHECK-LABEL: @ugtKnownBitsVec(
+; CHECK-NEXT: [[B:%.*]] = and <2 x i8> %a, <i8 17, i8 17>
+; CHECK-NEXT: [[CMP:%.*]] = icmp ugt <2 x i8> [[B]], <i8 16, i8 16>
+; CHECK-NEXT: ret <2 x i1> [[CMP]]
+;
+ %b = and <2 x i8> %a, <i8 17, i8 17>
+ %cmp = icmp ugt <2 x i8> %b, <i8 16, i8 16>
+ ret <2 x i1> %cmp
+}
+
OpenPOWER on IntegriCloud