[llvm] r278708 - [InstCombine] add test for missing vector icmp fold

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 15 11:39:55 PDT 2016


Author: spatel
Date: Mon Aug 15 13:39:54 2016
New Revision: 278708

URL: http://llvm.org/viewvc/llvm-project?rev=278708&view=rev
Log:
[InstCombine] add test for missing vector icmp fold

Modified:
    llvm/trunk/test/Transforms/InstCombine/shift.ll

Modified: llvm/trunk/test/Transforms/InstCombine/shift.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/shift.ll?rev=278708&r1=278707&r2=278708&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/shift.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/shift.ll Mon Aug 15 13:39:54 2016
@@ -506,6 +506,18 @@ define i1 @test28(i8 %x) {
   ret i1 %cmp
 }
 
+; FIXME: Vectors should fold the same way.
+define <2 x i1> @test28vec(<2 x i8> %x) {
+; CHECK-LABEL: @test28vec(
+; CHECK-NEXT:    [[SHR:%.*]] = lshr <2 x i8> %x, <i8 7, i8 7>
+; CHECK-NEXT:    [[CMP:%.*]] = icmp ne <2 x i8> [[SHR]], zeroinitializer
+; CHECK-NEXT:    ret <2 x i1> [[CMP]]
+;
+  %shr = lshr <2 x i8> %x, <i8 7, i8 7>
+  %cmp = icmp ne <2 x i8> %shr, zeroinitializer
+  ret <2 x i1> %cmp
+}
+
 define i8 @test28a(i8 %x, i8 %y) {
 ; CHECK-LABEL: @test28a(
 ; CHECK-NEXT:  entry:




More information about the llvm-commits mailing list