brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 448d7b5 Raw
34 lines · plain
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-PREFETCH3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 -prefetch-distance=20 \4; RUN:   -stop-after=loop-data-prefetch | FileCheck %s -check-prefix=NEAR-PREFETCH5;6; Check that prefetches are not emitted when the known constant trip count of7; the loop is smaller than the estimated "iterations ahead" of the prefetch.8;9; FAR-PREFETCH-LABEL: fun10; FAR-PREFETCH-NOT: call void @llvm.prefetch11 12; NEAR-PREFETCH-LABEL: fun13; NEAR-PREFETCH: call void @llvm.prefetch14 15 16define void @fun(ptr nocapture %Src, ptr nocapture readonly %Dst) {17entry:18  br label %for.body19 20for.cond.cleanup:                                 ; preds = %for.body21  ret void22 23for.body:                                         ; preds = %for.body, %entry24  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.9, %for.body ]25  %arrayidx = getelementptr inbounds i32, ptr %Dst, i64 %indvars.iv26  %0 = load i32, ptr %arrayidx, align 427  %arrayidx2 = getelementptr inbounds i32, ptr %Src, i64 %indvars.iv28  store i32 %0, ptr %arrayidx2, align 429  %indvars.iv.next.9 = add nuw nsw i64 %indvars.iv, 160030  %cmp.9 = icmp ult i64 %indvars.iv.next.9, 1120031  br i1 %cmp.9, label %for.body, label %for.cond.cleanup32}33 34