[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
This commit is contained in:
Sanjay Patel 2016-08-17 16:23:15 +00:00
parent 926ddae882
commit 9bec09deff

View File

@ -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(