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

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 15 13:02:40 PDT 2016


Author: spatel
Date: Mon Aug 15 15:02:40 2016
New Revision: 278727

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

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

Modified: llvm/trunk/test/Transforms/InstCombine/icmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp.ll?rev=278727&r1=278726&r2=278727&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/icmp.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/icmp.ll Mon Aug 15 15:02:40 2016
@@ -282,6 +282,18 @@ define i1 @test23(i32 %x) {
   ret i1 %i4
 }
 
+; FIXME: Vectors should fold too.
+define <2 x i1> @test23vec(<2 x i32> %x) {
+; CHECK-LABEL: @test23vec(
+; CHECK-NEXT:    [[I3:%.*]] = sdiv <2 x i32> %x, <i32 -1328634635, i32 -1328634635>
+; CHECK-NEXT:    [[I4:%.*]] = icmp eq <2 x i32> [[I3]], <i32 -1, i32 -1>
+; CHECK-NEXT:    ret <2 x i1> [[I4]]
+;
+  %i3 = sdiv <2 x i32> %x, <i32 -1328634635, i32 -1328634635>
+  %i4 = icmp eq <2 x i32> %i3, <i32 -1, i32 -1>
+  ret <2 x i1> %i4
+}
+
 @X = global [1000 x i32] zeroinitializer
 
 ; PR8882




More information about the llvm-commits mailing list