1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; The load access to A has a pointer-bitcast to another elements size before the
4 ; GetElementPtr. Verify that we do not the GEP delinearization because it
5 ; mismatches with the size of the loaded element type.
7 ; void f(short A[][4], int N, int P) {
8 ; short(*B)[4] = &A[P][0];
9 ; for (int i = 0; i < N; i++)
10 ; *((<4 x short> *)&A[7 * i][0]) = *((<4 x short>)&B[7 * i][0]);
13 define void @f(ptr %A, i32 %N, i32 %P) {
15 %arrayidx1 = getelementptr inbounds [4 x i16], ptr %A, i32 %P, i64 0
19 %indvars.iv = phi i32 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
20 %cmp = icmp slt i32 %indvars.iv, %N
21 br i1 %cmp, label %for.body, label %for.end
24 %mul = mul nsw i32 %indvars.iv, 7
25 %arrayidx4 = getelementptr inbounds [4 x i16], ptr %arrayidx1, i32 %mul, i64 0
26 %tmp3 = load <4 x i16>, ptr %arrayidx4
27 %arrayidx8 = getelementptr inbounds [4 x i16], ptr %A, i32 %mul, i64 0
28 store <4 x i16> %tmp3, ptr %arrayidx8
32 %indvars.iv.next = add nuw nsw i32 %indvars.iv, 1
41 ; CHECK-NEXT: <4 x i16> MemRef_A[*]; // Element size 8
44 ; CHECK-NEXT: Stmt_for_body
45 ; CHECK-NEXT: Domain :=
46 ; CHECK-NEXT: [N, P] -> { Stmt_for_body[i0] : 0 <= i0 < N };
47 ; CHECK-NEXT: Schedule :=
48 ; CHECK-NEXT: [N, P] -> { Stmt_for_body[i0] -> [i0] };
49 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
50 ; CHECK-NEXT: [N, P] -> { Stmt_for_body[i0] -> MemRef_A[P + 7i0] };
51 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
52 ; CHECK-NEXT: [N, P] -> { Stmt_for_body[i0] -> MemRef_A[7i0] };