1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -S --passes=slp-vectorizer -mtriple=arm-- -mattr=+neon < %s | FileCheck %s
4 define void @test(ptr %a, ptr %b, ptr %r) {
5 ; CHECK-LABEL: define void @test(
6 ; CHECK-SAME: ptr [[A:%.*]], ptr [[B:%.*]], ptr [[R:%.*]]) #[[ATTR0:[0-9]+]] {
7 ; CHECK-NEXT: [[V_A_0:%.*]] = load float, ptr [[A]], align 4
8 ; CHECK-NEXT: [[A_1:%.*]] = getelementptr i8, ptr [[A]], i64 4
9 ; CHECK-NEXT: [[V_A_1:%.*]] = load float, ptr [[A_1]], align 4
10 ; CHECK-NEXT: [[A_2:%.*]] = getelementptr i8, ptr [[A]], i64 8
11 ; CHECK-NEXT: [[V_A_2:%.*]] = load float, ptr [[A_2]], align 4
12 ; CHECK-NEXT: [[A_3:%.*]] = getelementptr i8, ptr [[A]], i64 12
13 ; CHECK-NEXT: [[V_A_3:%.*]] = load float, ptr [[A_3]], align 4
14 ; CHECK-NEXT: [[V_B_0:%.*]] = load float, ptr [[B]], align 4
15 ; CHECK-NEXT: [[B_1:%.*]] = getelementptr i8, ptr [[B]], i64 4
16 ; CHECK-NEXT: [[V_B_1:%.*]] = load float, ptr [[B_1]], align 4
17 ; CHECK-NEXT: [[B_2:%.*]] = getelementptr i8, ptr [[B]], i64 8
18 ; CHECK-NEXT: [[V_B_2:%.*]] = load float, ptr [[B_2]], align 4
19 ; CHECK-NEXT: [[B_3:%.*]] = getelementptr i8, ptr [[B]], i64 12
20 ; CHECK-NEXT: [[V_B_3:%.*]] = load float, ptr [[B_3]], align 4
21 ; CHECK-NEXT: [[V_R_0:%.*]] = fadd float [[V_A_0]], [[V_B_0]]
22 ; CHECK-NEXT: [[V_R_1:%.*]] = fadd float [[V_A_1]], [[V_B_1]]
23 ; CHECK-NEXT: [[V_R_2:%.*]] = fadd float [[V_A_2]], [[V_B_2]]
24 ; CHECK-NEXT: [[V_R_3:%.*]] = fadd float [[V_A_3]], [[V_B_3]]
25 ; CHECK-NEXT: store float [[V_R_0]], ptr [[R]], align 4
26 ; CHECK-NEXT: [[R_1:%.*]] = getelementptr i8, ptr [[R]], i64 4
27 ; CHECK-NEXT: store float [[V_R_1]], ptr [[R_1]], align 4
28 ; CHECK-NEXT: [[R_2:%.*]] = getelementptr i8, ptr [[R]], i64 8
29 ; CHECK-NEXT: store float [[V_R_2]], ptr [[R_2]], align 4
30 ; CHECK-NEXT: [[R_3:%.*]] = getelementptr i8, ptr [[R]], i64 12
31 ; CHECK-NEXT: store float [[V_R_3]], ptr [[R_3]], align 4
32 ; CHECK-NEXT: ret void
34 %v.a.0 = load float, ptr %a
35 %a.1 = getelementptr i8, ptr %a, i64 4
36 %v.a.1 = load float, ptr %a.1
37 %a.2 = getelementptr i8, ptr %a, i64 8
38 %v.a.2 = load float, ptr %a.2
39 %a.3 = getelementptr i8, ptr %a, i64 12
40 %v.a.3 = load float, ptr %a.3
41 %v.b.0 = load float, ptr %b
42 %b.1 = getelementptr i8, ptr %b, i64 4
43 %v.b.1 = load float, ptr %b.1
44 %b.2 = getelementptr i8, ptr %b, i64 8
45 %v.b.2 = load float, ptr %b.2
46 %b.3 = getelementptr i8, ptr %b, i64 12
47 %v.b.3 = load float, ptr %b.3
48 %v.r.0 = fadd float %v.a.0, %v.b.0
49 %v.r.1 = fadd float %v.a.1, %v.b.1
50 %v.r.2 = fadd float %v.a.2, %v.b.2
51 %v.r.3 = fadd float %v.a.3, %v.b.3
52 store float %v.r.0, ptr %r
53 %r.1 = getelementptr i8, ptr %r, i64 4
54 store float %v.r.1, ptr %r.1
55 %r.2 = getelementptr i8, ptr %r, i64 8
56 store float %v.r.2, ptr %r.2
57 %r.3 = getelementptr i8, ptr %r, i64 12
58 store float %v.r.3, ptr %r.3