Skip to content

Commit bc8a2ae

Browse files
committed
add pre-test
1 parent 1987f93 commit bc8a2ae

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

llvm/test/Transforms/VectorCombine/X86/select-shuffle.ll

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,20 @@ end:
3636
%t5 = shufflevector <4 x double> %t3, <4 x double> %t4, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
3737
ret <4 x double> %t5
3838
}
39+
40+
define <8 x i16> @shuffle_select_select(<4 x i16> %x, <4 x i16> %y, <4 x i16> %z) {
41+
; CHECK-LABEL: @shuffle_select_select(
42+
; CHECK-NEXT: [[CMP_XY:%.*]] = icmp slt <4 x i16> [[X:%.*]], [[Y:%.*]]
43+
; CHECK-NEXT: [[CMP_YZ:%.*]] = icmp slt <4 x i16> [[Y]], [[Z:%.*]]
44+
; CHECK-NEXT: [[SELECT_XZ:%.*]] = select <4 x i1> [[CMP_XY]], <4 x i16> [[X]], <4 x i16> [[Z]]
45+
; CHECK-NEXT: [[SELECT_YX:%.*]] = select <4 x i1> [[CMP_YZ]], <4 x i16> [[Y]], <4 x i16> [[X]]
46+
; CHECK-NEXT: [[RES:%.*]] = shufflevector <4 x i16> [[SELECT_XZ]], <4 x i16> [[SELECT_YX]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
47+
; CHECK-NEXT: ret <8 x i16> [[RES]]
48+
;
49+
%cmp.xy = icmp slt <4 x i16> %x, %y
50+
%cmp.yz = icmp slt <4 x i16> %y, %z
51+
%select.xz = select <4 x i1> %cmp.xy, <4 x i16> %x, <4 x i16> %z
52+
%select.yx = select <4 x i1> %cmp.yz, <4 x i16> %y, <4 x i16> %x
53+
%res = shufflevector <4 x i16> %select.xz, <4 x i16> %select.yx, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
54+
ret <8 x i16> %res
55+
}

0 commit comments

Comments
 (0)