1 ; RUN: opt -mtriple=x86_64-unknown-linux-gnu -passes=load-store-vectorizer -mcpu haswell -S -o - %s | FileCheck --check-prefix=CHECK-HSW %s
2 ; RUN: opt -mtriple=x86_64-unknown-linux-gnu -passes=load-store-vectorizer -mcpu knl -S -o - %s | FileCheck --check-prefix=CHECK-KNL %s
3 ; RUN: opt -mtriple=x86_64-unknown-linux-gnu -aa-pipeline=basic-aa -passes='function(load-store-vectorizer)' -mcpu haswell -S -o - %s | FileCheck --check-prefix=CHECK-HSW %s
4 ; RUN: opt -mtriple=x86_64-unknown-linux-gnu -aa-pipeline=basic-aa -passes='function(load-store-vectorizer)' -mcpu knl -S -o - %s | FileCheck --check-prefix=CHECK-KNL %s
6 define <8 x double> @loadwidth_insert_extract(ptr %ptr) {
7 %b = getelementptr <2 x double>, ptr %ptr, i32 1
8 %c = getelementptr <2 x double>, ptr %ptr, i32 2
9 %d = getelementptr <2 x double>, ptr %ptr, i32 3
10 ; CHECK-HSW: load <4 x double>
11 ; CHECK-HSW: load <4 x double>
13 ; CHECK-KNL: load <8 x double>
15 %la = load <2 x double>, ptr %ptr
16 %lb = load <2 x double>, ptr %b
17 %lc = load <2 x double>, ptr %c
18 %ld = load <2 x double>, ptr %d
19 ; Scalarize everything - Explicitly not a shufflevector to test this code
21 %v1 = extractelement <2 x double> %la, i32 0
22 %v2 = extractelement <2 x double> %la, i32 1
23 %v3 = extractelement <2 x double> %lb, i32 0
24 %v4 = extractelement <2 x double> %lb, i32 1
25 %v5 = extractelement <2 x double> %lc, i32 0
26 %v6 = extractelement <2 x double> %lc, i32 1
27 %v7 = extractelement <2 x double> %ld, i32 0
28 %v8 = extractelement <2 x double> %ld, i32 1
30 %i1 = insertelement <8 x double> poison, double %v1, i32 0
31 %i2 = insertelement <8 x double> %i1, double %v2, i32 1
32 %i3 = insertelement <8 x double> %i2, double %v3, i32 2
33 %i4 = insertelement <8 x double> %i3, double %v4, i32 3
34 %i5 = insertelement <8 x double> %i4, double %v5, i32 4
35 %i6 = insertelement <8 x double> %i5, double %v6, i32 5
36 %i7 = insertelement <8 x double> %i6, double %v7, i32 6
37 %i8 = insertelement <8 x double> %i7, double %v8, i32 7