Fix two warnings in polly, -Wmismatched-tags and -Wreorder
[polly-mirror.git] / test / ScopInfo / mod_ref_access_pointee_arguments.ll
blob927c4e533230fdc2a0ec9a6ab41731957d19124a
1 ; RUN: opt %loadPolly -basicaa -polly-scops -analyze -polly-allow-modref-calls \
2 ; RUN:  < %s | FileCheck %s
3 ; RUN: opt %loadPolly -basicaa -polly-codegen -polly-allow-modref-calls \
4 ; RUN: -disable-output < %s
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.
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] };
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 ;    }
28 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
30 define void @jd(i32* noalias %A, i32* noalias %B) {
31 entry:
32   br label %for.cond
34 for.cond:                                         ; preds = %for.inc, %entry
35   %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
36   %exitcond = icmp ne i64 %indvars.iv, 1024
37   br i1 %exitcond, label %for.body, label %for.end
39 for.body:                                         ; preds = %for.cond
40   %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
41   %arrayidx2 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv
42   %bc = bitcast i32* %arrayidx to i8*
43   call void @f(i8* %bc, i32 1, i32 1, i32 1)
44   %tmp = load i32, i32* %arrayidx2
45   store i32 %tmp, i32* %arrayidx, align 4
46   br label %for.inc
48 for.inc:                                          ; preds = %for.body
49   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
50   br label %for.cond
52 for.end:                                          ; preds = %for.cond
53   ret void
56 declare void @f(i8*, i32, i32, i32) #0
58 attributes #0 = { argmemonly nounwind }