1*cee313d2SEric Christopher; RUN: opt < %s -loop-vectorize -S | FileCheck %s
2*cee313d2SEric Christopher
3*cee313d2SEric Christopher; CHECK: fadd
4*cee313d2SEric Christopher; CHECK-NEXT: fadd
5*cee313d2SEric Christopher; CHECK-NEXT: fadd
6*cee313d2SEric Christopher; CHECK-NEXT: fadd
7*cee313d2SEric Christopher; CHECK-NEXT: fadd
8*cee313d2SEric Christopher; CHECK-NEXT: fadd
9*cee313d2SEric Christopher; CHECK-NEXT: fadd
10*cee313d2SEric Christopher; CHECK-NEXT: fadd
11*cee313d2SEric Christopher; CHECK-NEXT: fadd
12*cee313d2SEric Christopher; CHECK-NEXT: fadd
13*cee313d2SEric Christopher; CHECK-NEXT: fadd
14*cee313d2SEric Christopher; CHECK-NEXT: fadd
15*cee313d2SEric Christopher; CHECK-NEXT: =
16*cee313d2SEric Christopher; CHECK-NOT: fadd
17*cee313d2SEric Christopher; CHECK-SAME: >
18*cee313d2SEric Christopher
19*cee313d2SEric Christophertarget datalayout = "e-m:e-i64:64-n32:64"
20*cee313d2SEric Christophertarget triple = "powerpc64le-ibm-linux-gnu"
21*cee313d2SEric Christopher
22*cee313d2SEric Christopherdefine void @QLA_F3_r_veq_norm2_V(float* noalias nocapture %r, [3 x { float, float }]* noalias nocapture readonly %a, i32 signext %n) #0 {
23*cee313d2SEric Christopherentry:
24*cee313d2SEric Christopher  %cmp24 = icmp sgt i32 %n, 0
25*cee313d2SEric Christopher  br i1 %cmp24, label %for.cond1.preheader.preheader, label %for.end13
26*cee313d2SEric Christopher
27*cee313d2SEric Christopherfor.cond1.preheader.preheader:                    ; preds = %entry
28*cee313d2SEric Christopher  br label %for.cond1.preheader
29*cee313d2SEric Christopher
30*cee313d2SEric Christopherfor.cond1.preheader:                              ; preds = %for.cond1.preheader.preheader, %for.cond1.preheader
31*cee313d2SEric Christopher  %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1.preheader ], [ 0, %for.cond1.preheader.preheader ]
32*cee313d2SEric Christopher  %sum.026 = phi double [ %add10.2, %for.cond1.preheader ], [ 0.000000e+00, %for.cond1.preheader.preheader ]
33*cee313d2SEric Christopher  %arrayidx5.realp = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 0, i32 0
34*cee313d2SEric Christopher  %arrayidx5.real = load float, float* %arrayidx5.realp, align 8
35*cee313d2SEric Christopher  %arrayidx5.imagp = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 0, i32 1
36*cee313d2SEric Christopher  %arrayidx5.imag = load float, float* %arrayidx5.imagp, align 8
37*cee313d2SEric Christopher  %mul = fmul fast float %arrayidx5.real, %arrayidx5.real
38*cee313d2SEric Christopher  %mul9 = fmul fast float %arrayidx5.imag, %arrayidx5.imag
39*cee313d2SEric Christopher  %add = fadd fast float %mul9, %mul
40*cee313d2SEric Christopher  %conv = fpext float %add to double
41*cee313d2SEric Christopher  %add10 = fadd fast double %conv, %sum.026
42*cee313d2SEric Christopher  %arrayidx5.realp.1 = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 1, i32 0
43*cee313d2SEric Christopher  %arrayidx5.real.1 = load float, float* %arrayidx5.realp.1, align 8
44*cee313d2SEric Christopher  %arrayidx5.imagp.1 = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 1, i32 1
45*cee313d2SEric Christopher  %arrayidx5.imag.1 = load float, float* %arrayidx5.imagp.1, align 8
46*cee313d2SEric Christopher  %mul.1 = fmul fast float %arrayidx5.real.1, %arrayidx5.real.1
47*cee313d2SEric Christopher  %mul9.1 = fmul fast float %arrayidx5.imag.1, %arrayidx5.imag.1
48*cee313d2SEric Christopher  %add.1 = fadd fast float %mul9.1, %mul.1
49*cee313d2SEric Christopher  %conv.1 = fpext float %add.1 to double
50*cee313d2SEric Christopher  %add10.1 = fadd fast double %conv.1, %add10
51*cee313d2SEric Christopher  %arrayidx5.realp.2 = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 2, i32 0
52*cee313d2SEric Christopher  %arrayidx5.real.2 = load float, float* %arrayidx5.realp.2, align 8
53*cee313d2SEric Christopher  %arrayidx5.imagp.2 = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 2, i32 1
54*cee313d2SEric Christopher  %arrayidx5.imag.2 = load float, float* %arrayidx5.imagp.2, align 8
55*cee313d2SEric Christopher  %mul.2 = fmul fast float %arrayidx5.real.2, %arrayidx5.real.2
56*cee313d2SEric Christopher  %mul9.2 = fmul fast float %arrayidx5.imag.2, %arrayidx5.imag.2
57*cee313d2SEric Christopher  %add.2 = fadd fast float %mul9.2, %mul.2
58*cee313d2SEric Christopher  %conv.2 = fpext float %add.2 to double
59*cee313d2SEric Christopher  %add10.2 = fadd fast double %conv.2, %add10.1
60*cee313d2SEric Christopher  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
61*cee313d2SEric Christopher  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
62*cee313d2SEric Christopher  %exitcond = icmp eq i32 %lftr.wideiv, %n
63*cee313d2SEric Christopher  br i1 %exitcond, label %for.cond.for.end13_crit_edge, label %for.cond1.preheader
64*cee313d2SEric Christopher
65*cee313d2SEric Christopherfor.cond.for.end13_crit_edge:                     ; preds = %for.cond1.preheader
66*cee313d2SEric Christopher  %add10.2.lcssa = phi double [ %add10.2, %for.cond1.preheader ]
67*cee313d2SEric Christopher  %phitmp = fptrunc double %add10.2.lcssa to float
68*cee313d2SEric Christopher  br label %for.end13
69*cee313d2SEric Christopher
70*cee313d2SEric Christopherfor.end13:                                        ; preds = %for.cond.for.end13_crit_edge, %entry
71*cee313d2SEric Christopher  %sum.0.lcssa = phi float [ %phitmp, %for.cond.for.end13_crit_edge ], [ 0.000000e+00, %entry ]
72*cee313d2SEric Christopher  store float %sum.0.lcssa, float* %r, align 4
73*cee313d2SEric Christopher  ret void
74*cee313d2SEric Christopher}
75*cee313d2SEric Christopher
76