62 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 '-passes=polly<no-default-opts>' -disable-output -polly-allow-modref-calls < %s3;4; Verify that we model the read access of the gcread intrinsic5; correctly, thus that A is read 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: ReadAccess := [Reduction Type: NONE]13; CHECK-NEXT: { Stmt_for_body[i0] -> MemRef_A[o0] };14; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE]15; CHECK-NEXT: { Stmt_for_body[i0] -> MemRef_dummyloc[0] };16; CHECK-NEXT: ReadAccess := [Reduction Type: NONE]17; CHECK-NEXT: { Stmt_for_body[i0] -> MemRef_B[i0] };18; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE]19; CHECK-NEXT: { Stmt_for_body[i0] -> MemRef_A[i0] };20;21; void jd(int *restirct A, int *restrict B) {22; char **dummyloc;23; for (int i = 0; i < 1024; i++) {24; char *dummy = @llvm.gcread(A, nullptr);25; *dummyloc = dummy;26; A[i] = B[i];27; }28; }29;30target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"31 32define void @jd(ptr noalias %A, ptr noalias %B) gc "dummy" {33entry:34 %dummyloc = alloca ptr35 br label %entry.split36 37entry.split: ; preds = %entry38 br label %for.body39 40for.body: ; preds = %entry.split, %for.inc41 %i = phi i64 [ 0, %entry.split ], [ %i.next, %for.inc ]42 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %i43 %arrayidx1 = getelementptr inbounds i32, ptr %B, i64 %i44 %dummy = call ptr @f(ptr %arrayidx, ptr null)45 store ptr %dummy, ptr %dummyloc, align 446 %tmp = load i32, ptr %arrayidx147 store i32 %tmp, ptr %arrayidx, align 448 br label %for.inc49 50for.inc: ; preds = %for.body51 %i.next = add nuw nsw i64 %i, 152 %exitcond = icmp ne i64 %i.next, 102453 br i1 %exitcond, label %for.body, label %for.end54 55for.end: ; preds = %for.inc56 ret void57}58 59declare ptr @f(ptr, ptr) #060 61attributes #0 = { argmemonly readonly nounwind }62