1 ; RUN: llc -enable-ppc-prefetching=true -verify-machineinstrs < %s | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64le-unknown-linux"
5 ; Function Attrs: nounwind
6 define void @foo(ptr %x, ptr nocapture readonly %y) #0 {
8 %scevgep = getelementptr double, ptr %x, i64 1599
9 %scevgep20 = getelementptr double, ptr %y, i64 1599
10 br label %vector.memcheck
12 vector.memcheck: ; preds = %for.end, %entry
13 %j.015 = phi i32 [ 0, %entry ], [ %inc7, %for.end ]
14 %bound0 = icmp uge ptr %scevgep20, %x
15 %bound1 = icmp uge ptr %scevgep, %y
16 %memcheck.conflict = and i1 %bound0, %bound1
17 br i1 %memcheck.conflict, label %middle.block, label %vector.body
19 vector.body: ; preds = %vector.memcheck, %vector.body
20 %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.memcheck ]
21 %0 = getelementptr inbounds double, ptr %y, i64 %index
22 %wide.load = load <4 x double>, ptr %0, align 8
23 %1 = fadd <4 x double> %wide.load, <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
24 %2 = getelementptr inbounds double, ptr %x, i64 %index
25 store <4 x double> %1, ptr %2, align 8
26 %index.next = add i64 %index, 4
27 %3 = icmp eq i64 %index.next, 1600
28 br i1 %3, label %middle.block, label %vector.body
30 middle.block: ; preds = %vector.body, %vector.memcheck
31 %resume.val = phi i1 [ false, %vector.memcheck ], [ true, %vector.body ]
32 %trunc.resume.val = phi i64 [ 0, %vector.memcheck ], [ 1600, %vector.body ]
33 br i1 %resume.val, label %for.end, label %for.body3
35 for.body3: ; preds = %middle.block, %for.body3
36 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ %trunc.resume.val, %middle.block ]
37 %arrayidx = getelementptr inbounds double, ptr %y, i64 %indvars.iv
38 %4 = load double, ptr %arrayidx, align 8
39 %add = fadd double %4, 1.000000e+00
40 %arrayidx5 = getelementptr inbounds double, ptr %x, i64 %indvars.iv
41 store double %add, ptr %arrayidx5, align 8
42 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
43 %exitcond = icmp eq i64 %indvars.iv.next, 1600
44 br i1 %exitcond, label %for.end, label %for.body3
46 for.end: ; preds = %middle.block, %for.body3
47 tail call void @bar(ptr %x) #2
48 %inc7 = add nuw nsw i32 %j.015, 1
49 %exitcond16 = icmp eq i32 %inc7, 100
50 br i1 %exitcond16, label %for.end8, label %vector.memcheck
52 for.end8: ; preds = %for.end
59 declare void @bar(ptr) #1
61 attributes #0 = { nounwind "target-cpu"="a2q" }
62 attributes #1 = { "target-cpu"="a2q" }
63 attributes #2 = { nounwind }