1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=slp-vectorizer -slp-threshold=0 < %s | FileCheck %s
4 define <4 x float> @simple_select(<4 x float> %a, <4 x float> %b, <4 x i32> %c) {
5 ; CHECK-LABEL: @simple_select(
6 ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <4 x i32> [[C:%.*]], <4 x i32> poison, <2 x i32> <i32 0, i32 1>
7 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne <2 x i32> [[TMP1]], zeroinitializer
8 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <2 x i32> <i32 0, i32 1>
9 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <4 x float> [[B:%.*]], <4 x float> poison, <2 x i32> <i32 0, i32 1>
10 ; CHECK-NEXT: [[TMP5:%.*]] = select <2 x i1> [[TMP2]], <2 x float> [[TMP3]], <2 x float> [[TMP4]]
11 ; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <2 x float> [[TMP5]], <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
12 ; CHECK-NEXT: ret <4 x float> [[TMP6]]
14 %c0 = extractelement <4 x i32> %c, i32 0
15 %c1 = extractelement <4 x i32> %c, i32 1
16 %a0 = extractelement <4 x float> %a, i32 0
17 %a1 = extractelement <4 x float> %a, i32 1
18 %b0 = extractelement <4 x float> %b, i32 0
19 %b1 = extractelement <4 x float> %b, i32 1
20 %cmp0 = icmp ne i32 %c0, 0
21 %cmp1 = icmp ne i32 %c1, 0
22 %s0 = select i1 %cmp0, float %a0, float %b0
23 %s1 = select i1 %cmp1, float %a1, float %b1
24 %ra = insertelement <4 x float> <float poison, float poison, float undef, float undef>, float %s0, i32 0
25 %rb = insertelement <4 x float> %ra, float %s1, i32 1