mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
add tests for icmp vector folds
llvm-svn: 276475
This commit is contained in:
parent
c8566f811b
commit
262eed8e23
@ -635,6 +635,18 @@ define i1 @test55(i32 %a) {
|
||||
ret i1 %cmp
|
||||
}
|
||||
|
||||
; FIXME: Vectors should fold the same way.
|
||||
define <2 x i1> @test55vec(<2 x i32> %a) {
|
||||
; CHECK-LABEL: @test55vec(
|
||||
; CHECK-NEXT: [[SUB:%.*]] = sub <2 x i32> zeroinitializer, %a
|
||||
; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i32> [[SUB]], <i32 123, i32 123>
|
||||
; CHECK-NEXT: ret <2 x i1> [[CMP]]
|
||||
;
|
||||
%sub = sub <2 x i32> zeroinitializer, %a
|
||||
%cmp = icmp eq <2 x i32> %sub, <i32 123, i32 123>
|
||||
ret <2 x i1> %cmp
|
||||
}
|
||||
|
||||
define i1 @test56(i32 %a) {
|
||||
; CHECK-LABEL: @test56(
|
||||
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 %a, -113
|
||||
@ -645,6 +657,18 @@ define i1 @test56(i32 %a) {
|
||||
ret i1 %cmp
|
||||
}
|
||||
|
||||
; FIXME: Vectors should fold the same way.
|
||||
define <2 x i1> @test56vec(<2 x i32> %a) {
|
||||
; CHECK-LABEL: @test56vec(
|
||||
; CHECK-NEXT: [[SUB:%.*]] = sub <2 x i32> <i32 10, i32 10>, %a
|
||||
; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i32> [[SUB]], <i32 123, i32 123>
|
||||
; CHECK-NEXT: ret <2 x i1> [[CMP]]
|
||||
;
|
||||
%sub = sub <2 x i32> <i32 10, i32 10>, %a
|
||||
%cmp = icmp eq <2 x i32> %sub, <i32 123, i32 123>
|
||||
ret <2 x i1> %cmp
|
||||
}
|
||||
|
||||
; PR10267 Don't make icmps more expensive when no other inst is subsumed.
|
||||
declare void @foo(i32)
|
||||
define i1 @test57(i32 %a) {
|
||||
|
Loading…
Reference in New Issue
Block a user