1 ; RUN: opt < %s -loop-vectorize -S -mcpu=pwr9 -interleave-small-loop-scalar-reduction=true 2>&1 | FileCheck %s
2 ; RUN: opt < %s -passes='loop-vectorize' -S -mcpu=pwr9 -interleave-small-loop-scalar-reduction=true 2>&1 | FileCheck %s
4 ; CHECK-LABEL: vector.body
5 ; CHECK: load double, double*
6 ; CHECK-NEXT: load double, double*
7 ; CHECK-NEXT: load double, double*
8 ; CHECK-NEXT: load double, double*
10 ; CHECK: fmul fast double
11 ; CHECK-NEXT: fmul fast double
12 ; CHECK-NEXT: fmul fast double
13 ; CHECK-NEXT: fmul fast double
15 ; CHECK: fadd fast double
16 ; CHECK-NEXT: fadd fast double
17 ; CHECK-NEXT: fadd fast double
18 ; CHECK-NEXT: fadd fast double
20 target datalayout = "e-m:e-i64:64-n32:64"
21 target triple = "powerpc64le-unknown-linux-gnu"
23 define dso_local void @test(i32*** %arg, double** %arg1) align 2 {
25 %tpm15 = load i32**, i32*** %arg, align 8
26 %tpm19 = load double*, double** %arg1, align 8
28 bb22: ; preds = %bb33, %bb
30 %tpm10 = alloca i32, align 8
31 %tpm27 = getelementptr inbounds i32, i32* %tpm10, i64 %tpm26
32 %tpm28 = getelementptr inbounds i32*, i32** %tpm15, i64 0
33 %tpm29 = load i32*, i32** %tpm28, align 8
34 %tpm17 = alloca double, align 8
35 %tpm32 = getelementptr inbounds double, double* %tpm17, i64 %tpm26
38 %tpm35 = getelementptr inbounds double, double* %tpm19, i64 0
39 %tpm37 = fsub fast double 0.000000e+00, %tpm50
40 store double %tpm37, double* %tpm35, align 8
42 bb40: ; preds = %bb40, %bb22
43 %tpm41 = phi i32* [ %tpm51, %bb40 ], [ %tpm27, %bb22 ]
44 %tpm42 = phi double* [ %tpm52, %bb40 ], [ %tpm32, %bb22 ]
45 %tpm43 = phi double [ %tpm50, %bb40 ], [ 0.000000e+00, %bb22 ]
46 %tpm44 = load double, double* %tpm42, align 8
47 %tpm45 = load i32, i32* %tpm41, align 4
48 %tpm46 = zext i32 %tpm45 to i64
49 %tpm47 = getelementptr inbounds double, double* %tpm19, i64 %tpm46
50 %tpm48 = load double, double* %tpm47, align 8
51 %tpm49 = fmul fast double %tpm48, %tpm44
52 %tpm50 = fadd fast double %tpm49, %tpm43
53 %tpm51 = getelementptr inbounds i32, i32* %tpm41, i64 1
54 %tpm52 = getelementptr inbounds double, double* %tpm42, i64 1
55 %tpm53 = icmp eq i32* %tpm51, %tpm29
56 br i1 %tpm53, label %bb33, label %bb40