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