• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 -prefetch-distance=100 \
2; RUN:   -stop-after=loop-data-prefetch | FileCheck %s -check-prefix=FAR-PREFETCH
3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 -prefetch-distance=20 \
4; RUN:   -stop-after=loop-data-prefetch | FileCheck %s -check-prefix=NEAR-PREFETCH
5;
6; Check that prefetches are not emitted when the known constant trip count of
7; the loop is smaller than the estimated "iterations ahead" of the prefetch.
8;
9; FAR-PREFETCH-LABEL: fun
10; FAR-PREFETCH-NOT: call void @llvm.prefetch
11
12; NEAR-PREFETCH-LABEL: fun
13; NEAR-PREFETCH: call void @llvm.prefetch
14
15
16define void @fun(i32* nocapture %Src, i32* nocapture readonly %Dst) {
17entry:
18  br label %for.body
19
20for.cond.cleanup:                                 ; preds = %for.body
21  ret void
22
23for.body:                                         ; preds = %for.body, %entry
24  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.9, %for.body ]
25  %arrayidx = getelementptr inbounds i32, i32* %Dst, i64 %indvars.iv
26  %0 = load i32, i32* %arrayidx, align 4
27  %arrayidx2 = getelementptr inbounds i32, i32* %Src, i64 %indvars.iv
28  store i32 %0, i32* %arrayidx2, align 4
29  %indvars.iv.next.9 = add nuw nsw i64 %indvars.iv, 1600
30  %cmp.9 = icmp ult i64 %indvars.iv.next.9, 11200
31  br i1 %cmp.9, label %for.body, label %for.cond.cleanup
32}
33
34