mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[InstCombine] add tests for missing vector folds
llvm-svn: 284245
This commit is contained in:
parent
8c7be2e26d
commit
037f524f36
@ -12,6 +12,17 @@ define i32 @test1(i32 %x) {
|
||||
ret i32 %sub
|
||||
}
|
||||
|
||||
define <2 x i32> @test1vec(<2 x i32> %x) {
|
||||
; CHECK-LABEL: @test1vec(
|
||||
; CHECK-NEXT: [[AND:%.*]] = and <2 x i32> %x, <i32 31, i32 31>
|
||||
; CHECK-NEXT: [[SUB:%.*]] = sub nsw <2 x i32> <i32 63, i32 63>, [[AND]]
|
||||
; CHECK-NEXT: ret <2 x i32> [[SUB]]
|
||||
;
|
||||
%and = and <2 x i32> %x, <i32 31, i32 31>
|
||||
%sub = sub <2 x i32> <i32 63, i32 63>, %and
|
||||
ret <2 x i32> %sub
|
||||
}
|
||||
|
||||
declare i32 @llvm.ctlz.i32(i32, i1) nounwind readnone
|
||||
|
||||
define i32 @test2(i32 %x) nounwind {
|
||||
|
@ -152,6 +152,28 @@ define i32 @test13(i32 %A) {
|
||||
ret i32 %C
|
||||
}
|
||||
|
||||
define <2 x i32> @test12vec(<2 x i32> %A) {
|
||||
; CHECK-LABEL: @test12vec(
|
||||
; CHECK-NEXT: [[B:%.*]] = ashr <2 x i32> %A, <i32 31, i32 31>
|
||||
; CHECK-NEXT: [[C:%.*]] = sub nsw <2 x i32> zeroinitializer, [[B]]
|
||||
; CHECK-NEXT: ret <2 x i32> [[C]]
|
||||
;
|
||||
%B = ashr <2 x i32> %A, <i32 31, i32 31>
|
||||
%C = sub <2 x i32> zeroinitializer, %B
|
||||
ret <2 x i32> %C
|
||||
}
|
||||
|
||||
define <2 x i32> @test13vec(<2 x i32> %A) {
|
||||
; CHECK-LABEL: @test13vec(
|
||||
; CHECK-NEXT: [[B:%.*]] = lshr <2 x i32> %A, <i32 31, i32 31>
|
||||
; CHECK-NEXT: [[C:%.*]] = sub nsw <2 x i32> zeroinitializer, [[B]]
|
||||
; CHECK-NEXT: ret <2 x i32> [[C]]
|
||||
;
|
||||
%B = lshr <2 x i32> %A, <i32 31, i32 31>
|
||||
%C = sub <2 x i32> zeroinitializer, %B
|
||||
ret <2 x i32> %C
|
||||
}
|
||||
|
||||
define i32 @test15(i32 %A, i32 %B) {
|
||||
; CHECK-LABEL: @test15(
|
||||
; CHECK-NEXT: [[C:%.*]] = sub i32 0, %A
|
||||
|
Loading…
Reference in New Issue
Block a user