llvm/test/CodeGen/AArch64/tailcall_misched_graph.ll: s/REQUIRE/REQUIRES/
[oota-llvm.git] / test / CodeGen / PowerPC / loop-data-prefetch-inner.ll
1 ; RUN: llc < %s | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64-bgq-linux"
4
5 ; Function Attrs: nounwind
6 define void @foo(double* %x, double* nocapture readonly %y) #0 {
7 entry:
8   %scevgep = getelementptr double, double* %x, i64 1599
9   %scevgep20 = getelementptr double, double* %y, i64 1599
10   br label %vector.memcheck
11
12 vector.memcheck:                                  ; preds = %for.end, %entry
13   %j.015 = phi i32 [ 0, %entry ], [ %inc7, %for.end ]
14   %bound0 = icmp uge double* %scevgep20, %x
15   %bound1 = icmp uge double* %scevgep, %y
16   %memcheck.conflict = and i1 %bound0, %bound1
17   br i1 %memcheck.conflict, label %middle.block, label %vector.body
18
19 vector.body:                                      ; preds = %vector.memcheck, %vector.body
20   %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.memcheck ]
21   %0 = getelementptr inbounds double, double* %y, i64 %index
22   %1 = bitcast double* %0 to <4 x double>*
23   %wide.load = load <4 x double>, <4 x double>* %1, align 8
24   %2 = fadd <4 x double> %wide.load, <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
25   %3 = getelementptr inbounds double, double* %x, i64 %index
26   %4 = bitcast double* %3 to <4 x double>*
27   store <4 x double> %2, <4 x double>* %4, align 8
28   %index.next = add i64 %index, 4
29   %5 = icmp eq i64 %index.next, 1600
30   br i1 %5, label %middle.block, label %vector.body
31
32 middle.block:                                     ; preds = %vector.body, %vector.memcheck
33   %resume.val = phi i1 [ false, %vector.memcheck ], [ true, %vector.body ]
34   %trunc.resume.val = phi i64 [ 0, %vector.memcheck ], [ 1600, %vector.body ]
35   br i1 %resume.val, label %for.end, label %for.body3
36
37 for.body3:                                        ; preds = %middle.block, %for.body3
38   %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ %trunc.resume.val, %middle.block ]
39   %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
40   %6 = load double, double* %arrayidx, align 8
41   %add = fadd double %6, 1.000000e+00
42   %arrayidx5 = getelementptr inbounds double, double* %x, i64 %indvars.iv
43   store double %add, double* %arrayidx5, align 8
44   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
45   %exitcond = icmp eq i64 %indvars.iv.next, 1600
46   br i1 %exitcond, label %for.end, label %for.body3
47
48 for.end:                                          ; preds = %middle.block, %for.body3
49   tail call void @bar(double* %x) #2
50   %inc7 = add nuw nsw i32 %j.015, 1
51   %exitcond16 = icmp eq i32 %inc7, 100
52   br i1 %exitcond16, label %for.end8, label %vector.memcheck
53
54 for.end8:                                         ; preds = %for.end
55   ret void
56
57 ; CHECK-LABEL: @foo
58 ; CHECK: dcbt
59 }
60
61 declare void @bar(double*) #1
62
63 attributes #0 = { nounwind "target-cpu"="a2q" }
64 attributes #1 = { "target-cpu"="a2q" }
65 attributes #2 = { nounwind }
66