[llvm] r291265 - [InstCombine] add a vector version of a test added in r291262; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 11:14:05 PST 2017


Author: spatel
Date: Fri Jan  6 13:14:05 2017
New Revision: 291265

URL: http://llvm.org/viewvc/llvm-project?rev=291265&view=rev
Log:
[InstCombine] add a vector version of a test added in r291262; NFC

Modified:
    llvm/trunk/test/Transforms/InstCombine/icmp-shl-nsw.ll

Modified: llvm/trunk/test/Transforms/InstCombine/icmp-shl-nsw.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp-shl-nsw.ll?rev=291265&r1=291264&r2=291265&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/icmp-shl-nsw.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/icmp-shl-nsw.ll Fri Jan  6 13:14:05 2017
@@ -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.
 




More information about the llvm-commits mailing list