1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=slp-vectorizer -mtriple=aarch64--linux-gnu -mcpu=generic < %s | FileCheck %s
3 ; RUN: opt -S -passes=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 -passes=slp-vectorizer -mtriple=aarch64--linux-gnu -mcpu=kryo < %s | FileCheck --check-prefix=NO_SLP %s
6 ; RUN: opt -S -passes=slp-vectorizer -mtriple=aarch64--linux-gnu -mcpu=generic -slp-min-reg-size=128 < %s | FileCheck --check-prefix=NO_SLP %s
8 define void @f(ptr %r, ptr %w) {
10 ; CHECK-NEXT: [[TMP2:%.*]] = load <2 x float>, ptr [[R:%.*]], align 4
11 ; CHECK-NEXT: [[TMP3:%.*]] = fadd <2 x float> [[TMP2]], [[TMP2]]
12 ; CHECK-NEXT: store <2 x float> [[TMP3]], ptr [[W:%.*]], align 4
13 ; CHECK-NEXT: ret void
16 ; NO_SLP-NEXT: [[R1:%.*]] = getelementptr inbounds float, ptr [[R:%.*]], i64 1
17 ; NO_SLP-NEXT: [[F0:%.*]] = load float, ptr [[R]], align 4
18 ; NO_SLP-NEXT: [[F1:%.*]] = load float, ptr [[R1]], align 4
19 ; NO_SLP-NEXT: [[ADD0:%.*]] = fadd float [[F0]], [[F0]]
20 ; NO_SLP-NEXT: [[ADD1:%.*]] = fadd float [[F1]], [[F1]]
21 ; NO_SLP-NEXT: [[W1:%.*]] = getelementptr inbounds float, ptr [[W:%.*]], i64 1
22 ; NO_SLP-NEXT: store float [[ADD0]], ptr [[W]], align 4
23 ; NO_SLP-NEXT: store float [[ADD1]], ptr [[W1]], align 4
24 ; NO_SLP-NEXT: ret void
26 %r1 = getelementptr inbounds float, ptr %r, i64 1
27 %f0 = load float, ptr %r
28 %f1 = load float, ptr %r1
29 %add0 = fadd float %f0, %f0
30 %add1 = fadd float %f1, %f1
31 %w1 = getelementptr inbounds float, ptr %w, i64 1
32 store float %add0, ptr %w
33 store float %add1, ptr %w1