2007-01-05 07:34:41 +00:00
|
|
|
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
|
|
|
|
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep vector_shuffle
|
2006-04-10 22:45:37 +00:00
|
|
|
|
|
|
|
%T = type <4 x float>
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
2007-01-26 08:25:06 +00:00
|
|
|
define %T @test1(%T %v1) {
|
2007-01-05 07:34:41 +00:00
|
|
|
%v2 = shufflevector %T %v1, %T undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
|
2006-04-10 22:45:37 +00:00
|
|
|
ret %T %v2
|
|
|
|
}
|
|
|
|
|
2007-01-26 08:25:06 +00:00
|
|
|
define %T @test2(%T %v1) {
|
2007-01-05 07:34:41 +00:00
|
|
|
%v2 = shufflevector %T %v1, %T %v1, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
|
2006-04-10 22:45:37 +00:00
|
|
|
ret %T %v2
|
|
|
|
}
|
|
|
|
|
2007-01-26 08:25:06 +00:00
|
|
|
define float @test3(%T %A, %T %B, float %f) {
|
2007-01-05 07:34:41 +00:00
|
|
|
%C = insertelement %T %A, float %f, i32 0
|
|
|
|
%D = shufflevector %T %C, %T %B, <4 x i32> <i32 5, i32 0, i32 2, i32 7>
|
|
|
|
%E = extractelement %T %D, i32 1
|
2006-04-10 23:06:18 +00:00
|
|
|
ret float %E
|
|
|
|
}
|
|
|
|
|
2007-01-26 08:25:06 +00:00
|
|
|
define i32 @test4(<4 x i32> %X) {
|
2007-01-05 07:34:41 +00:00
|
|
|
%tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> zeroinitializer
|
|
|
|
%tmp34 = extractelement <4 x i32> %tmp152.i53899.i, i32 0
|
|
|
|
ret i32 %tmp34
|
2006-05-25 22:52:49 +00:00
|
|
|
}
|
|
|
|
|
2007-01-26 08:25:06 +00:00
|
|
|
define i32 @test5(<4 x i32> %X) {
|
2007-01-05 07:34:41 +00:00
|
|
|
%tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 undef, i32 undef>
|
|
|
|
%tmp34 = extractelement <4 x i32> %tmp152.i53899.i, i32 0
|
|
|
|
ret i32 %tmp34
|
2006-05-25 22:52:49 +00:00
|
|
|
}
|
|
|
|
|
2007-01-26 08:25:06 +00:00
|
|
|
define float @test6(<4 x float> %X) {
|
2007-01-05 07:34:41 +00:00
|
|
|
%X = bitcast <4 x float> %X to <4 x i32>
|
|
|
|
%tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> zeroinitializer
|
|
|
|
%tmp152.i53900.i = bitcast <4 x i32> %tmp152.i53899.i to <4 x float>
|
|
|
|
%tmp34 = extractelement <4 x float> %tmp152.i53900.i, i32 0
|
2006-05-25 23:23:22 +00:00
|
|
|
ret float %tmp34
|
|
|
|
}
|
|
|
|
|
2007-01-26 08:25:06 +00:00
|
|
|
define <4 x float> @test7(<4 x float> %tmp45.i) {
|
2007-01-05 07:35:24 +00:00
|
|
|
%tmp1642.i = shufflevector <4 x float> %tmp45.i, <4 x float> undef, <4 x i32> < i32 0, i32 1, i32 6, i32 7 >
|
|
|
|
ret <4 x float> %tmp1642.i
|
|
|
|
}
|