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

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 09:23:16 PDT 2016


Author: spatel
Date: Wed Aug 17 11:23:15 2016
New Revision: 278943

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

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

Modified: llvm/trunk/test/Transforms/InstCombine/or.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/or.ll?rev=278943&r1=278942&r2=278943&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/or.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/or.ll Wed Aug 17 11:23:15 2016
@@ -307,6 +307,21 @@ define i1 @test27(i32* %A, i32* %B) {
   ret i1 %E
 }
 
+define <2 x i1> @test27vec(<2 x i32*> %A, <2 x i32*> %B) {
+; CHECK-LABEL: @test27vec(
+; CHECK-NEXT:    [[C1:%.*]] = ptrtoint <2 x i32*> %A to <2 x i32>
+; CHECK-NEXT:    [[C2:%.*]] = ptrtoint <2 x i32*> %B to <2 x i32>
+; CHECK-NEXT:    [[D:%.*]] = or <2 x i32> [[C1]], [[C2]]
+; CHECK-NEXT:    [[E:%.*]] = icmp eq <2 x i32> [[D]], zeroinitializer
+; CHECK-NEXT:    ret <2 x i1> [[E]]
+;
+  %C1 = ptrtoint <2 x i32*> %A to <2 x i32>
+  %C2 = ptrtoint <2 x i32*> %B to <2 x i32>
+  %D = or <2 x i32> %C1, %C2
+  %E = icmp eq <2 x i32> %D, zeroinitializer
+  ret <2 x i1> %E
+}
+
 ; PR5634
 define i1 @test28(i32 %A, i32 %B) {
 ; CHECK-LABEL: @test28(
@@ -335,6 +350,21 @@ define i1 @test29(i32* %A, i32* %B) {
   ret i1 %E
 }
 
+define <2 x i1> @test29vec(<2 x i32*> %A, <2 x i32*> %B) {
+; CHECK-LABEL: @test29vec(
+; CHECK-NEXT:    [[C1:%.*]] = ptrtoint <2 x i32*> %A to <2 x i32>
+; CHECK-NEXT:    [[C2:%.*]] = ptrtoint <2 x i32*> %B to <2 x i32>
+; CHECK-NEXT:    [[D:%.*]] = or <2 x i32> [[C1]], [[C2]]
+; CHECK-NEXT:    [[E:%.*]] = icmp ne <2 x i32> [[D]], zeroinitializer
+; CHECK-NEXT:    ret <2 x i1> [[E]]
+;
+  %C1 = ptrtoint <2 x i32*> %A to <2 x i32>
+  %C2 = ptrtoint <2 x i32*> %B to <2 x i32>
+  %D = or <2 x i32> %C1, %C2
+  %E = icmp ne <2 x i32> %D, zeroinitializer
+  ret <2 x i1> %E
+}
+
 ; PR4216
 define i32 @test30(i32 %A) {
 ; CHECK-LABEL: @test30(




More information about the llvm-commits mailing list