From 9bec09deff813648dff388935414eb0b17072a85 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 17 Aug 2016 16:23:15 +0000 Subject: [PATCH] [InstCombine] add tests for missing vector icmp folds git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278943 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/or.ll | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/Transforms/InstCombine/or.ll b/test/Transforms/InstCombine/or.ll index 53cb48809fc..6e053908b84 100644 --- a/test/Transforms/InstCombine/or.ll +++ b/test/Transforms/InstCombine/or.ll @@ -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(