1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
4 define <2 x float> @foo() {
7 ; CHECK-NEXT: [[SOURCE:%.*]] = insertelement <2 x float> undef, float undef, i32 0
8 ; CHECK-NEXT: [[TMP0:%.*]] = fsub <2 x float> [[SOURCE]], [[SOURCE]]
9 ; CHECK-NEXT: [[TMP1:%.*]] = extractelement <2 x float> [[TMP0]], i32 0
10 ; CHECK-NEXT: [[RES1:%.*]] = insertelement <2 x float> undef, float [[TMP1]], i32 0
11 ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <2 x float> [[TMP0]], i32 1
12 ; CHECK-NEXT: [[RES2:%.*]] = insertelement <2 x float> [[RES1]], float [[TMP2]], i32 1
13 ; CHECK-NEXT: ret <2 x float> [[RES2]]
16 %source = insertelement <2 x float> undef, float undef, i32 0
17 %e0 = extractelement <2 x float> %source, i32 0
18 %e0.dup = extractelement <2 x float> %source, i32 0
19 %sub1 = fsub float %e0, %e0.dup
20 %e1 = extractelement <2 x float> %source, i32 1
21 %e1.dup = extractelement <2 x float> %source, i32 1
22 %sub2 = fsub float %e1, %e1.dup
23 %res1 = insertelement <2 x float> undef, float %sub1, i32 0
24 %res2 = insertelement <2 x float> %res1, float %sub2, i32 1
28 !llvm.ident = !{!0, !0}
30 !0 = !{!"clang version 4.0.0 "}