]> granicus.if.org Git - llvm/commitdiff
[InstCombine] add a vector version of a test added in r291262; NFC
authorSanjay Patel <spatel@rotateright.com>
Fri, 6 Jan 2017 19:14:05 +0000 (19:14 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 6 Jan 2017 19:14:05 +0000 (19:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291265 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/icmp-shl-nsw.ll

index 85e397ec24156296fab9903dac21b9a462c5f1b0..896a45625b9f216309aeed320ec0c0dbc3a2cc62 100644 (file)
@@ -201,5 +201,18 @@ define i1 @icmp_sgt11(i8 %x) {
   ret i1 %cmp
 }
 
+; Splat vector version should fold the same way.
+
+define <2 x i1> @icmp_sgt11_vec(<2 x i8> %x) {
+; CHECK-LABEL: @icmp_sgt11_vec(
+; CHECK-NEXT:    [[SHL:%.*]] = shl nsw <2 x i8> %x, <i8 7, i8 7>
+; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt <2 x i8> [[SHL]], <i8 -2, i8 -2>
+; CHECK-NEXT:    ret <2 x i1> [[CMP]]
+;
+  %shl = shl nsw <2 x i8> %x, <i8 7, i8 7>
+  %cmp = icmp sgt <2 x i8> %shl, <i8 -2, i8 -2>
+  ret <2 x i1> %cmp
+}
+
 ; Known bits analysis returns false for compares with >=0.