OSDN Git Service

[InstCombine] add tests for missing vector icmp folds
authorSanjay Patel <spatel@rotateright.com>
Fri, 19 Aug 2016 15:27:28 +0000 (15:27 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 19 Aug 2016 15:27:28 +0000 (15:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279259 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/icmp.ll

index 2d2dfb5..7aae75b 100644 (file)
@@ -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
+}
+