1 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
3 %class.FullMatrix = type { i8 }
4 %class.Vector = type { ptr }
8 define weak_odr void @test(ptr %this, ptr dereferenceable(8) %p1, ptr dereferenceable(8), i1 zeroext) {
10 %call = tail call signext i32 @fn1(ptr %this)
11 %cmp10 = icmp sgt i32 %call, 0
12 br i1 %cmp10, label %for.body.lr.ph, label %for.cond.cleanup
14 for.body.lr.ph: ; preds = %entry
15 %2 = load ptr, ptr %p1, align 8
16 %wide.trip.count = zext i32 %call to i64
17 %min.iters.check = icmp ult i32 %call, 4
18 br i1 %min.iters.check, label %for.body.preheader, label %min.iters.checked
20 for.body.preheader: ; preds = %middle.block, %min.iters.checked, %for.body.lr.ph
21 %indvars.iv.ph = phi i64 [ 0, %min.iters.checked ], [ 0, %for.body.lr.ph ], [ %n.vec, %middle.block ]
24 min.iters.checked: ; preds = %for.body.lr.ph
26 %n.mod.vf = zext i32 %3 to i64
27 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
28 %cmp.zero = icmp eq i64 %n.vec, 0
29 br i1 %cmp.zero, label %for.body.preheader, label %vector.body.preheader
31 vector.body.preheader: ; preds = %min.iters.checked
34 vector.body: ; preds = %vector.body.preheader, %vector.body
35 %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.body.preheader ]
36 %4 = getelementptr inbounds float, ptr %2, i64 %index
37 %wide.load = load <4 x float>, ptr %4, align 4
38 %5 = fpext <4 x float> %wide.load to <4 x ppc_fp128>
39 %6 = fadd <4 x ppc_fp128> %5, %5
40 %7 = fptrunc <4 x ppc_fp128> %6 to <4 x float>
41 store <4 x float> %7, ptr %4, align 4
42 %index.next = add i64 %index, 4
43 %8 = icmp eq i64 %index.next, %n.vec
44 br i1 %8, label %middle.block, label %vector.body
46 middle.block: ; preds = %vector.body
47 %cmp.n = icmp eq i32 %3, 0
48 br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader
50 for.cond.cleanup.loopexit: ; preds = %for.body
51 br label %for.cond.cleanup
53 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %middle.block, %entry
56 for.body: ; preds = %for.body.preheader, %for.body
57 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ]
58 %arrayidx.i = getelementptr inbounds float, ptr %2, i64 %indvars.iv
59 %9 = load float, ptr %arrayidx.i, align 4
60 %conv = fpext float %9 to ppc_fp128
61 %add = fadd ppc_fp128 %conv, %conv
62 %conv4 = fptrunc ppc_fp128 %add to float
63 store float %conv4, ptr %arrayidx.i, align 4
64 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
65 %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count
66 br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body
71 declare signext i32 @fn1(ptr) local_unnamed_addr #1