1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -slp-vectorizer -S < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver2 | FileCheck %s
4 define float @jacobi(float* %p, float %x, float %y, float %z) {
5 ; CHECK-LABEL: @jacobi(
6 ; CHECK-NEXT: [[GEP1:%.*]] = getelementptr float, float* [[P:%.*]], i64 1
7 ; CHECK-NEXT: [[GEP2:%.*]] = getelementptr float, float* [[P]], i64 2
8 ; CHECK-NEXT: [[P1:%.*]] = load float, float* [[GEP1]]
9 ; CHECK-NEXT: [[P2:%.*]] = load float, float* [[GEP2]]
10 ; CHECK-NEXT: [[MUL1:%.*]] = fmul float [[P1]], [[X:%.*]]
11 ; CHECK-NEXT: [[MUL2:%.*]] = fmul float [[P2]], [[Y:%.*]]
12 ; CHECK-NEXT: [[ADD1:%.*]] = fadd float [[MUL1]], [[Z:%.*]]
13 ; CHECK-NEXT: [[ADD2:%.*]] = fadd float [[MUL2]], [[ADD1]]
14 ; CHECK-NEXT: ret float [[ADD2]]
16 %gep1 = getelementptr float, float* %p, i64 1
17 %gep2 = getelementptr float, float* %p, i64 2
18 %p1 = load float, float* %gep1
19 %p2 = load float, float* %gep2
20 %mul1 = fmul float %p1, %x
21 %mul2 = fmul float %p2, %y
22 %add1 = fadd float %mul1, %z
23 %add2 = fadd float %mul2, %add1