xref: /llvm-project/llvm/test/Transforms/LoadStoreVectorizer/X86/load-width-inseltpoison.ll (revision ba1759c498367c09d0dd7bcccad2ef0c138ca06e)
1d6e7e477SRoman Lebedev; RUN: opt -mtriple=x86_64-unknown-linux-gnu -passes=load-store-vectorizer -mcpu haswell -S -o - %s | FileCheck --check-prefix=CHECK-HSW %s
2d6e7e477SRoman Lebedev; RUN: opt -mtriple=x86_64-unknown-linux-gnu -passes=load-store-vectorizer -mcpu knl -S -o - %s | FileCheck --check-prefix=CHECK-KNL %s
3db7a2f34SJuneyoung Lee; 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
4db7a2f34SJuneyoung Lee; 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
5db7a2f34SJuneyoung Lee
6*ba1759c4SNikita Popovdefine <8 x double> @loadwidth_insert_extract(ptr %ptr) {
7*ba1759c4SNikita Popov    %b = getelementptr <2 x double>, ptr %ptr, i32 1
8*ba1759c4SNikita Popov    %c = getelementptr <2 x double>, ptr %ptr, i32 2
9*ba1759c4SNikita Popov    %d = getelementptr <2 x double>, ptr %ptr, i32 3
10db7a2f34SJuneyoung Lee; CHECK-HSW: load <4 x double>
11db7a2f34SJuneyoung Lee; CHECK-HSW: load <4 x double>
12db7a2f34SJuneyoung Lee; CHECK-HSW-NOT: load
13db7a2f34SJuneyoung Lee; CHECK-KNL: load <8 x double>
14db7a2f34SJuneyoung Lee; CHECK-KNL-NOT: load
15*ba1759c4SNikita Popov    %la = load <2 x double>, ptr %ptr
16*ba1759c4SNikita Popov    %lb = load <2 x double>, ptr %b
17*ba1759c4SNikita Popov    %lc = load <2 x double>, ptr %c
18*ba1759c4SNikita Popov    %ld = load <2 x double>, ptr %d
19db7a2f34SJuneyoung Lee    ; Scalarize everything - Explicitly not a shufflevector to test this code
20db7a2f34SJuneyoung Lee    ; path in the LSV
21db7a2f34SJuneyoung Lee    %v1 = extractelement <2 x double> %la, i32 0
22db7a2f34SJuneyoung Lee    %v2 = extractelement <2 x double> %la, i32 1
23db7a2f34SJuneyoung Lee    %v3 = extractelement <2 x double> %lb, i32 0
24db7a2f34SJuneyoung Lee    %v4 = extractelement <2 x double> %lb, i32 1
25db7a2f34SJuneyoung Lee    %v5 = extractelement <2 x double> %lc, i32 0
26db7a2f34SJuneyoung Lee    %v6 = extractelement <2 x double> %lc, i32 1
27db7a2f34SJuneyoung Lee    %v7 = extractelement <2 x double> %ld, i32 0
28db7a2f34SJuneyoung Lee    %v8 = extractelement <2 x double> %ld, i32 1
29db7a2f34SJuneyoung Lee    ; Make a vector again
30db7a2f34SJuneyoung Lee    %i1 = insertelement <8 x double> poison, double %v1, i32 0
31db7a2f34SJuneyoung Lee    %i2 = insertelement <8 x double> %i1, double %v2, i32 1
32db7a2f34SJuneyoung Lee    %i3 = insertelement <8 x double> %i2, double %v3, i32 2
33db7a2f34SJuneyoung Lee    %i4 = insertelement <8 x double> %i3, double %v4, i32 3
34db7a2f34SJuneyoung Lee    %i5 = insertelement <8 x double> %i4, double %v5, i32 4
35db7a2f34SJuneyoung Lee    %i6 = insertelement <8 x double> %i5, double %v6, i32 5
36db7a2f34SJuneyoung Lee    %i7 = insertelement <8 x double> %i6, double %v7, i32 6
37db7a2f34SJuneyoung Lee    %i8 = insertelement <8 x double> %i7, double %v8, i32 7
38db7a2f34SJuneyoung Lee    ret <8 x double> %i8
39db7a2f34SJuneyoung Lee}
40