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