53 lines · plain
1; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -polly-stmt-granularity=bb '-passes=polly-custom<scops>' -polly-print-scops -polly-allow-modref-calls -disable-output < %s 2>&1 | FileCheck %s2; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -polly-stmt-granularity=bb '-passes=polly<no-default-opts>' -polly-allow-modref-calls -disable-output < %s3;4; Verify that we model the may-write access of the prefetch intrinsic5; correctly, thus that A is accessed by it but B is not.6;7; CHECK: Stmt_for_body8; CHECK-NEXT: Domain :=9; CHECK-NEXT: { Stmt_for_body[i0] : 0 <= i0 <= 1023 };10; CHECK-NEXT: Schedule :=11; CHECK-NEXT: { Stmt_for_body[i0] -> [i0] };12; CHECK-NEXT: MayWriteAccess := [Reduction Type: NONE]13; CHECK-NEXT: { Stmt_for_body[i0] -> MemRef_A[o0] };14; CHECK-NEXT: ReadAccess := [Reduction Type: NONE]15; CHECK-NEXT: { Stmt_for_body[i0] -> MemRef_B[i0] };16; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE]17; CHECK-NEXT: { Stmt_for_body[i0] -> MemRef_A[i0] };18;19; void jd(int *restirct A, int *restrict B) {20; for (int i = 0; i < 1024; i++) {21; @llvm.prefetch(A);22; A[i] = B[i];23; }24; }25;26target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"27 28define void @jd(ptr noalias %A, ptr noalias %B) {29entry:30 br label %for.body31 32for.body: ; preds = %entry, %for.inc33 %i = phi i64 [ 0, %entry ], [ %i.next, %for.inc ]34 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %i35 %arrayidx1 = getelementptr inbounds i32, ptr %B, i64 %i36 call void @f(ptr %arrayidx, i32 1, i32 1, i32 1)37 %tmp = load i32, ptr %arrayidx138 store i32 %tmp, ptr %arrayidx, align 439 br label %for.inc40 41for.inc: ; preds = %for.body42 %i.next = add nuw nsw i64 %i, 143 %exitcond = icmp ne i64 %i.next, 102444 br i1 %exitcond, label %for.body, label %for.end45 46for.end: ; preds = %for.inc47 ret void48}49 50declare void @f(ptr, i32, i32, i32) #051 52attributes #0 = { argmemonly nounwind }53