1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -slp-vectorizer -S -mtriple=thumb7 -mcpu=swift | FileCheck %s
4 define <4 x i32> @PR13837(<4 x float> %in) {
5 ; CHECK-LABEL: @PR13837(
6 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi <4 x float> [[IN:%.*]] to <4 x i32>
7 ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x i32> [[TMP1]], i32 0
8 ; CHECK-NEXT: [[V0:%.*]] = insertelement <4 x i32> undef, i32 [[TMP2]], i32 0
9 ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <4 x i32> [[TMP1]], i32 1
10 ; CHECK-NEXT: [[V1:%.*]] = insertelement <4 x i32> [[V0]], i32 [[TMP3]], i32 1
11 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP1]], i32 2
12 ; CHECK-NEXT: [[V2:%.*]] = insertelement <4 x i32> [[V1]], i32 [[TMP4]], i32 2
13 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
14 ; CHECK-NEXT: [[V3:%.*]] = insertelement <4 x i32> [[V2]], i32 [[TMP5]], i32 3
15 ; CHECK-NEXT: ret <4 x i32> [[V3]]
17 %t0 = extractelement <4 x float> %in, i64 0
18 %t1 = extractelement <4 x float> %in, i64 1
19 %t2 = extractelement <4 x float> %in, i64 2
20 %t3 = extractelement <4 x float> %in, i64 3
21 %c0 = fptosi float %t0 to i32
22 %c1 = fptosi float %t1 to i32
23 %c2 = fptosi float %t2 to i32
24 %c3 = fptosi float %t3 to i32
25 %v0 = insertelement <4 x i32> undef, i32 %c0, i32 0
26 %v1 = insertelement <4 x i32> %v0, i32 %c1, i32 1
27 %v2 = insertelement <4 x i32> %v1, i32 %c2, i32 2
28 %v3 = insertelement <4 x i32> %v2, i32 %c3, i32 3