1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s \
2 ; RUN: -polly-invariant-load-hoisting \
5 ; Verify that we canonicalize accesses even tough one of the accesses (even
6 ; the canonical base) has a partial execution context. This is correct as
7 ; the combined execution context still covers both accesses.
9 ; CHECK: Invariant Accesses: {
10 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
11 ; CHECK-NEXT: { Stmt_body2[i0] -> MemRef_A[0] };
12 ; CHECK-NEXT: Execution Context: { : }
16 ; CHECK-NEXT: Domain :=
17 ; CHECK-NEXT: { Stmt_body1[i0] : 0 <= i0 <= 1022 };
18 ; CHECK-NEXT: Schedule :=
19 ; CHECK-NEXT: { Stmt_body1[i0] -> [i0, 0] };
20 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
21 ; CHECK-NEXT: { Stmt_body1[i0] -> MemRef_baseB[0] };
22 ; CHECK-NEXT: Stmt_body2
23 ; CHECK-NEXT: Domain :=
24 ; CHECK-NEXT: { Stmt_body2[i0] : 0 <= i0 <= 510 };
25 ; CHECK-NEXT: Schedule :=
26 ; CHECK-NEXT: { Stmt_body2[i0] -> [i0, 1] };
27 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
28 ; CHECK-NEXT: { Stmt_body2[i0] -> MemRef_baseB[0] };
31 define void @foo(ptr %A) {
36 %indvar = phi i64 [0, %start], [%indvar.next, %latch]
37 %indvar.next = add nsw i64 %indvar, 1
38 %icmp = icmp slt i64 %indvar.next, 1024
39 br i1 %icmp, label %body1, label %exit
42 %baseA = load ptr, ptr %A
43 store float 42.0, ptr %baseA
44 %cmp = icmp slt i64 %indvar.next, 512
45 br i1 %cmp, label %body2, label %latch
48 %baseB = load ptr, ptr %A
49 store float 42.0, ptr %baseB