1; RUN: opt %loadPolly -polly-scops -analyze < %s \
2; RUN:  -polly-invariant-load-hoisting \
3; RUN:  | FileCheck %s
4
5; CHECK:      Stmt_body1
6; CHECK-NEXT:       Domain :=
7; CHECK-NEXT:           { Stmt_body1[i0] : 0 <= i0 <= 1022 };
8; CHECK-NEXT:       Schedule :=
9; CHECK-NEXT:           { Stmt_body1[i0] -> [i0, 0] };
10; CHECK-NEXT:       MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
11; CHECK-NEXT:          { Stmt_body1[i0] -> MemRef_baseB[0] };
12; CHECK-NEXT: Stmt_body2
13; CHECK-NEXT:       Domain :=
14; CHECK-NEXT:           { Stmt_body2[i0] : 0 <= i0 <= 1022 };
15; CHECK-NEXT:       Schedule :=
16; CHECK-NEXT:           { Stmt_body2[i0] -> [i0, 1] };
17; CHECK-NEXT:       MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
18; CHECK-NEXT:                { Stmt_body2[i0] -> MemRef_baseB[0] };
19
20define void @foo(float** %A) {
21start:
22  br label %loop
23
24loop:
25  %indvar = phi i64 [0, %start], [%indvar.next, %latch]
26  %indvar.next = add nsw i64 %indvar, 1
27  %icmp = icmp slt i64 %indvar.next, 1024
28  br i1 %icmp, label %body1, label %exit
29
30body1:
31  %baseA = load float*, float** %A
32  store float 42.0, float* %baseA
33  br label %body2
34
35body2:
36  %baseB = load float*, float** %A
37  store float 42.0, float* %baseB
38  br label %latch
39
40latch:
41  br label %loop
42
43exit:
44  ret void
45
46}
47