1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[InstCombine] add tests for missing vector icmp folds

llvm-svn: 278709
This commit is contained in:
Sanjay Patel 2016-08-15 18:45:10 +00:00
parent 13ec2e4fa5
commit fed91af079

View File

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