1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -slp-vectorizer -mtriple=aarch64--linux-gnu -mcpu=generic < %s | FileCheck %s
3 ; RUN: opt -S -slp-vectorizer -mtriple=aarch64-apple-ios -mcpu=cyclone < %s | FileCheck %s
4 ; Currently disabled for a few subtargets (e.g. Kryo):
5 ; RUN: opt -S -slp-vectorizer -mtriple=aarch64--linux-gnu -mcpu=kryo < %s | FileCheck --check-prefix=NO_SLP %s
6 ; RUN: opt -S -slp-vectorizer -mtriple=aarch64--linux-gnu -mcpu=generic -slp-min-reg-size=128 < %s | FileCheck --check-prefix=NO_SLP %s
8 define void @f(float* %r, float* %w) {
10 ; CHECK-NEXT: [[R0:%.*]] = getelementptr inbounds float, float* [[R:%.*]], i64 0
11 ; CHECK-NEXT: [[R1:%.*]] = getelementptr inbounds float, float* [[R]], i64 1
12 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast float* [[R0]] to <2 x float>*
13 ; CHECK-NEXT: [[TMP2:%.*]] = load <2 x float>, <2 x float>* [[TMP1]], align 4
14 ; CHECK-NEXT: [[TMP3:%.*]] = fadd <2 x float> [[TMP2]], [[TMP2]]
15 ; CHECK-NEXT: [[W0:%.*]] = getelementptr inbounds float, float* [[W:%.*]], i64 0
16 ; CHECK-NEXT: [[W1:%.*]] = getelementptr inbounds float, float* [[W]], i64 1
17 ; CHECK-NEXT: [[TMP4:%.*]] = bitcast float* [[W0]] to <2 x float>*
18 ; CHECK-NEXT: store <2 x float> [[TMP3]], <2 x float>* [[TMP4]], align 4
19 ; CHECK-NEXT: ret void
22 ; NO_SLP-NEXT: [[R0:%.*]] = getelementptr inbounds float, float* [[R:%.*]], i64 0
23 ; NO_SLP-NEXT: [[R1:%.*]] = getelementptr inbounds float, float* [[R]], i64 1
24 ; NO_SLP-NEXT: [[F0:%.*]] = load float, float* [[R0]]
25 ; NO_SLP-NEXT: [[F1:%.*]] = load float, float* [[R1]]
26 ; NO_SLP-NEXT: [[ADD0:%.*]] = fadd float [[F0]], [[F0]]
27 ; NO_SLP-NEXT: [[ADD1:%.*]] = fadd float [[F1]], [[F1]]
28 ; NO_SLP-NEXT: [[W0:%.*]] = getelementptr inbounds float, float* [[W:%.*]], i64 0
29 ; NO_SLP-NEXT: [[W1:%.*]] = getelementptr inbounds float, float* [[W]], i64 1
30 ; NO_SLP-NEXT: store float [[ADD0]], float* [[W0]]
31 ; NO_SLP-NEXT: store float [[ADD1]], float* [[W1]]
32 ; NO_SLP-NEXT: ret void
34 %r0 = getelementptr inbounds float, float* %r, i64 0
35 %r1 = getelementptr inbounds float, float* %r, i64 1
36 %f0 = load float, float* %r0
37 %f1 = load float, float* %r1
38 %add0 = fadd float %f0, %f0
39 %add1 = fadd float %f1, %f1
40 %w0 = getelementptr inbounds float, float* %w, i64 0
41 %w1 = getelementptr inbounds float, float* %w, i64 1
42 store float %add0, float* %w0
43 store float %add1, float* %w1