brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 6edd0ff Raw
48 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 32; RUN: opt -mtriple=riscv64 -cache-line-size=64 -prefetch-distance=64 \3; RUN:   -passes=loop-data-prefetch -S < %s | FileCheck %s4 5define void @foo(ptr nocapture %a, ptr nocapture readonly %b) {6; CHECK-LABEL: define void @foo(7; CHECK-SAME: ptr captures(none) [[A:%.*]], ptr readonly captures(none) [[B:%.*]]) {8; CHECK-NEXT:  entry:9; CHECK-NEXT:    br label [[FOR_BODY:%.*]]10; CHECK:       for.body:11; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]12; CHECK-NEXT:    [[TMP0:%.*]] = shl nuw nsw i64 [[INDVARS_IV]], 313; CHECK-NEXT:    [[TMP1:%.*]] = add i64 [[TMP0]], 6414; CHECK-NEXT:    [[SCEVGEP1:%.*]] = getelementptr i8, ptr [[A]], i64 [[TMP1]]15; CHECK-NEXT:    [[TMP4:%.*]] = shl nuw nsw i64 [[INDVARS_IV]], 316; CHECK-NEXT:    [[TMP3:%.*]] = add i64 [[TMP4]], 6417; CHECK-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, ptr [[B]], i64 [[TMP3]]18; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds double, ptr [[B]], i64 [[INDVARS_IV]]19; CHECK-NEXT:    call void @llvm.prefetch.p0(ptr [[SCEVGEP]], i32 0, i32 3, i32 1)20; CHECK-NEXT:    [[TMP2:%.*]] = load double, ptr [[ARRAYIDX]], align 821; CHECK-NEXT:    [[ADD:%.*]] = fadd double [[TMP2]], 1.000000e+0022; CHECK-NEXT:    [[ARRAYIDX2:%.*]] = getelementptr inbounds double, ptr [[A]], i64 [[INDVARS_IV]]23; CHECK-NEXT:    call void @llvm.prefetch.p0(ptr [[SCEVGEP1]], i32 1, i32 3, i32 1)24; CHECK-NEXT:    store double [[ADD]], ptr [[ARRAYIDX2]], align 825; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 126; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT]], 160027; CHECK-NEXT:    br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]28; CHECK:       for.end:29; CHECK-NEXT:    ret void30;31entry:32  br label %for.body33 34for.body:                                         ; preds = %for.body, %entry35  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]36  %arrayidx = getelementptr inbounds double, ptr %b, i64 %indvars.iv37  %0 = load double, ptr %arrayidx, align 838  %add = fadd double %0, 1.000000e+0039  %arrayidx2 = getelementptr inbounds double, ptr %a, i64 %indvars.iv40  store double %add, ptr %arrayidx2, align 841  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 142  %exitcond = icmp eq i64 %indvars.iv.next, 160043  br i1 %exitcond, label %for.end, label %for.body44 45for.end:                                          ; preds = %for.body46  ret void47}48