@@ -37,6 +37,16 @@ define i16 @test7(i32 %A) {
37
37
ret i16 %D
38
38
}
39
39
40
+ define <2 x i16 > @test7_vector (<2 x i32 > %A ) {
41
+ ; CHECK-LABEL: @test7_vector(
42
+ ; CHECK-NEXT: ret <2 x i16> undef
43
+ ;
44
+ %B = tail call <2 x i32 > @llvm.bswap.v2i32 (<2 x i32 > %A ) nounwind
45
+ %C = trunc <2 x i32 > %B to <2 x i16 >
46
+ %D = tail call <2 x i16 > @llvm.bswap.v2i16 (<2 x i16 > %C ) nounwind
47
+ ret <2 x i16 > %D
48
+ }
49
+
40
50
define i16 @test8 (i64 %A ) {
41
51
; CHECK-LABEL: @test8(
42
52
; CHECK-NEXT: [[TMP1:%.*]] = lshr i64 [[A:%.*]], 48
@@ -49,6 +59,16 @@ define i16 @test8(i64 %A) {
49
59
ret i16 %D
50
60
}
51
61
62
+ define <2 x i16 > @test8_vector (<2 x i64 > %A ) {
63
+ ; CHECK-LABEL: @test8_vector(
64
+ ; CHECK-NEXT: ret <2 x i16> undef
65
+ ;
66
+ %B = tail call <2 x i64 > @llvm.bswap.v2i64 (<2 x i64 > %A ) nounwind
67
+ %C = trunc <2 x i64 > %B to <2 x i16 >
68
+ %D = tail call <2 x i16 > @llvm.bswap.v2i16 (<2 x i16 > %C ) nounwind
69
+ ret <2 x i16 > %D
70
+ }
71
+
52
72
; Misc: Fold bswap(undef) to undef.
53
73
define i64 @foo () {
54
74
; CHECK-LABEL: @foo(
@@ -334,4 +354,6 @@ define i64 @bs_and64i_multiuse(i64 %a, i64 %b) #0 {
334
354
declare i16 @llvm.bswap.i16 (i16 )
335
355
declare i32 @llvm.bswap.i32 (i32 )
336
356
declare i64 @llvm.bswap.i64 (i64 )
357
+ declare <2 x i16 > @llvm.bswap.v2i16 (<2 x i16 >)
337
358
declare <2 x i32 > @llvm.bswap.v2i32 (<2 x i32 >)
359
+ declare <2 x i64 > @llvm.bswap.v2i64 (<2 x i64 >)
0 commit comments