1 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-scops -disable-output < %s | FileCheck %s
3 ; In this test case we pass a pointer %A into a PHI node and also use this
4 ; pointer as base pointer of an array store. As a result, we get both scalar
5 ; and array memory accesses to A[] and A[0].
8 ; CHECK-NEXT: float MemRef_A[*]; // Element size 4
9 ; CHECK-NEXT: ptr MemRef_x__phi; // Element size 8
10 ; CHECK-NEXT: ptr MemRef_C[*]; // Element size 8
12 ; CHECK: Arrays (Bounds as pw_affs) {
13 ; CHECK-NEXT: float MemRef_A[*]; // Element size 4
14 ; CHECK-NEXT: ptr MemRef_x__phi; // Element size 8
15 ; CHECK-NEXT: ptr MemRef_C[*]; // Element size 8
17 ; CHECK: Alias Groups (0):
20 ; CHECK-NEXT: Stmt_then
21 ; CHECK-NEXT: Domain :=
22 ; CHECK-NEXT: [p] -> { Stmt_then[i0] : p = 32 and 0 <= i0 <= 999 };
23 ; CHECK-NEXT: Schedule :=
24 ; CHECK-NEXT: [p] -> { Stmt_then[i0] -> [i0, 1] };
25 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
26 ; CHECK-NEXT: [p] -> { Stmt_then[i0] -> MemRef_A[0] };
27 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
28 ; CHECK-NEXT: [p] -> { Stmt_then[i0] -> MemRef_x__phi[] };
29 ; CHECK-NEXT: Stmt_else
30 ; CHECK-NEXT: Domain :=
31 ; CHECK-NEXT: [p] -> { Stmt_else[i0] : 0 <= i0 <= 999 and (p >= 33 or p <= 31) };
32 ; CHECK-NEXT: Schedule :=
33 ; CHECK-NEXT: [p] -> { Stmt_else[i0] -> [i0, 0] : p >= 33 or p <= 31 };
34 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
35 ; CHECK-NEXT: [p] -> { Stmt_else[i0] -> MemRef_A[0] };
36 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
37 ; CHECK-NEXT: [p] -> { Stmt_else[i0] -> MemRef_x__phi[] };
38 ; CHECK-NEXT: Stmt_bb8
39 ; CHECK-NEXT: Domain :=
40 ; CHECK-NEXT: [p] -> { Stmt_bb8[i0] : 0 <= i0 <= 999 };
41 ; CHECK-NEXT: Schedule :=
42 ; CHECK-NEXT: [p] -> { Stmt_bb8[i0] -> [i0, 2] };
43 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
44 ; CHECK-NEXT: [p] -> { Stmt_bb8[i0] -> MemRef_x__phi[] };
45 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
46 ; CHECK-NEXT: [p] -> { Stmt_bb8[i0] -> MemRef_C[0] };
49 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
51 define void @foo(ptr noalias %A, ptr noalias %B, ptr noalias %C, i32 %p) {
56 %i.0 = phi i64 [ 0, %bb ], [ %tmp9, %bb8 ]
57 %exitcond = icmp ne i64 %i.0, 1000
58 br i1 %exitcond, label %bb2, label %bb10
61 %cmp = icmp eq i32 %p, 32
62 br i1 %cmp, label %then, label %else
65 store float 3.0, ptr %A
69 store float 4.0, ptr %A
73 %x = phi ptr [%A, %then], [%B, %else]
75 %tmp9 = add nuw nsw i64 %i.0, 1