236
|
1 ; RUN: opt %loadPolly -basic-aa -polly-stmt-granularity=bb -polly-print-scops -polly-allow-modref-calls \
|
|
2 ; RUN: -disable-output < %s | FileCheck %s
|
221
|
3 ; RUN: opt %loadPolly -basic-aa -polly-stmt-granularity=bb -polly-codegen -polly-allow-modref-calls \
|
236
|
4 ; RUN: -disable-output < %s
|
150
|
5 ;
|
|
6 ; Verify that we model the may-write access of the prefetch intrinsic
|
|
7 ; correctly, thus that A is accessed by it but B is not.
|
|
8 ;
|
|
9 ; CHECK: Stmt_for_body
|
|
10 ; CHECK-NEXT: Domain :=
|
|
11 ; CHECK-NEXT: { Stmt_for_body[i0] : 0 <= i0 <= 1023 };
|
|
12 ; CHECK-NEXT: Schedule :=
|
|
13 ; CHECK-NEXT: { Stmt_for_body[i0] -> [i0] };
|
|
14 ; CHECK-NEXT: MayWriteAccess := [Reduction Type: NONE]
|
|
15 ; CHECK-NEXT: { Stmt_for_body[i0] -> MemRef_A[o0] };
|
|
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 ; for (int i = 0; i < 1024; i++) {
|
|
23 ; @llvm.prefetch(A);
|
|
24 ; A[i] = B[i];
|
|
25 ; }
|
|
26 ; }
|
|
27 ;
|
|
28 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
29
|
252
|
30 define void @jd(ptr noalias %A, ptr noalias %B) {
|
150
|
31 entry:
|
|
32 br label %for.body
|
|
33
|
|
34 for.body: ; preds = %entry, %for.inc
|
|
35 %i = phi i64 [ 0, %entry ], [ %i.next, %for.inc ]
|
252
|
36 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %i
|
|
37 %arrayidx1 = getelementptr inbounds i32, ptr %B, i64 %i
|
|
38 call void @f(ptr %arrayidx, i32 1, i32 1, i32 1)
|
|
39 %tmp = load i32, ptr %arrayidx1
|
|
40 store i32 %tmp, ptr %arrayidx, align 4
|
150
|
41 br label %for.inc
|
|
42
|
|
43 for.inc: ; preds = %for.body
|
|
44 %i.next = add nuw nsw i64 %i, 1
|
|
45 %exitcond = icmp ne i64 %i.next, 1024
|
|
46 br i1 %exitcond, label %for.body, label %for.end
|
|
47
|
|
48 for.end: ; preds = %for.inc
|
|
49 ret void
|
|
50 }
|
|
51
|
252
|
52 declare void @f(ptr, i32, i32, i32) #0
|
150
|
53
|
|
54 attributes #0 = { argmemonly nounwind }
|