xref: /llvm-project/llvm/test/Transforms/LoopDataPrefetch/PowerPC/basic.ll (revision 055fb7795aa219a3d274d280ec9129784f169f56)
1d28f8672SJinsong Ji; RUN: opt -mcpu=a2 -passes=loop-data-prefetch -mtriple=powerpc64le-unknown-linux -enable-ppc-prefetching -S < %s | FileCheck %s
2cee313d2SEric Christophertarget datalayout = "E-m:e-i64:64-n32:64"
3cee313d2SEric Christopher
4*055fb779SNikita Popovdefine void @foo(ptr nocapture %a, ptr nocapture readonly %b) {
5cee313d2SEric Christopherentry:
6cee313d2SEric Christopher  br label %for.body
7cee313d2SEric Christopher
8cee313d2SEric Christopher; CHECK: for.body:
9cee313d2SEric Christopherfor.body:                                         ; preds = %for.body, %entry
10cee313d2SEric Christopher  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
11*055fb779SNikita Popov  %arrayidx = getelementptr inbounds double, ptr %b, i64 %indvars.iv
12cee313d2SEric Christopher; CHECK: call void @llvm.prefetch
13*055fb779SNikita Popov  %0 = load double, ptr %arrayidx, align 8
14cee313d2SEric Christopher  %add = fadd double %0, 1.000000e+00
15*055fb779SNikita Popov  %arrayidx2 = getelementptr inbounds double, ptr %a, i64 %indvars.iv
16*055fb779SNikita Popov  store double %add, ptr %arrayidx2, align 8
17cee313d2SEric Christopher  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
18cee313d2SEric Christopher  %exitcond = icmp eq i64 %indvars.iv.next, 1600
19cee313d2SEric Christopher  br i1 %exitcond, label %for.end, label %for.body
20cee313d2SEric Christopher
21cee313d2SEric Christopher; CHECK: for.end:
22cee313d2SEric Christopherfor.end:                                          ; preds = %for.body
23cee313d2SEric Christopher  ret void
24cee313d2SEric Christopher}
25