[llvm] r278709 - [InstCombine] add tests for missing vector icmp folds

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


Author: spatel
Date: Mon Aug 15 13:45:10 2016
New Revision: 278709

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

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=278709&r1=278708&r2=278709&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/icmp.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/icmp.ll Mon Aug 15 13:45:10 2016
@@ -476,6 +476,17 @@ define i1 @test39(i32 %X, i32 %Y) {
   ret i1 %B
 }
 
+define <2 x i1> @test39vec(<2 x i32> %X, <2 x i32> %Y) {
+; CHECK-LABEL: @test39vec(
+; CHECK-NEXT:    [[A:%.*]] = ashr exact <2 x i32> %X, %Y
+; CHECK-NEXT:    [[B:%.*]] = icmp eq <2 x i32> [[A]], zeroinitializer
+; CHECK-NEXT:    ret <2 x i1> [[B]]
+;
+  %A = ashr exact <2 x i32> %X, %Y
+  %B = icmp eq <2 x i32> %A, zeroinitializer
+  ret <2 x i1> %B
+}
+
 define i1 @test40(i32 %X, i32 %Y) {
 ; CHECK-LABEL: @test40(
 ; CHECK-NEXT:    [[B:%.*]] = icmp ne i32 %X, 0
@@ -486,6 +497,17 @@ define i1 @test40(i32 %X, i32 %Y) {
   ret i1 %B
 }
 
+define <2 x i1> @test40vec(<2 x i32> %X, <2 x i32> %Y) {
+; CHECK-LABEL: @test40vec(
+; CHECK-NEXT:    [[A:%.*]] = lshr exact <2 x i32> %X, %Y
+; CHECK-NEXT:    [[B:%.*]] = icmp ne <2 x i32> [[A]], zeroinitializer
+; CHECK-NEXT:    ret <2 x i1> [[B]]
+;
+  %A = lshr exact <2 x i32> %X, %Y
+  %B = icmp ne <2 x i32> %A, zeroinitializer
+  ret <2 x i1> %B
+}
+
 ; PR9343 #3
 define i1 @test41(i32 %X, i32 %Y) {
 ; CHECK-LABEL: @test41(




More information about the llvm-commits mailing list