1 ; RUN: opt %loadPolly -polly-scops -pass-remarks-analysis="polly-scops" \
2 ; RUN: -polly-allow-differing-element-types \
3 ; RUN: -analyze < %s 2>&1 | FileCheck %s
5 ; void foo(long n, long m, char A[][m]) {
6 ; for (long i = 0; i < n; i++)
7 ; for (long j = 0; j < m / 4; j++)
8 ; A[i][j] = *(float *)&A[i][4 * j];
11 ; We do not yet correctly handle multi-dimensional arrays which are accessed
12 ; through different base types. Verify that we correctly bail out.
14 ; CHECK: Delinearization assumption: { : 1 = 0 }
16 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
18 define void @foo(i64 %n, i64 %m, i8* %A) {
22 bb1: ; preds = %bb20, %bb
23 %i.0 = phi i64 [ 0, %bb ], [ %tmp21, %bb20 ]
24 %tmp = icmp slt i64 %i.0, %n
25 br i1 %tmp, label %bb2, label %bb22
30 bb3: ; preds = %bb17, %bb2
31 %j.0 = phi i64 [ 0, %bb2 ], [ %tmp18, %bb17 ]
32 %tmp4 = sdiv i64 %m, 4
33 %tmp5 = icmp slt i64 %j.0, %tmp4
34 br i1 %tmp5, label %bb6, label %bb19
37 %tmp7 = shl nsw i64 %j.0, 2
38 %tmp8 = mul nsw i64 %i.0, %m
39 %tmp9 = getelementptr inbounds i8, i8* %A, i64 %tmp8
40 %tmp10 = getelementptr inbounds i8, i8* %tmp9, i64 %tmp7
41 %tmp11 = bitcast i8* %tmp10 to float*
42 %tmp12 = load float, float* %tmp11, align 4
43 %tmp13 = fptosi float %tmp12 to i8
44 %tmp14 = mul nsw i64 %i.0, %m
45 %tmp15 = getelementptr inbounds i8, i8* %A, i64 %tmp14
46 %tmp16 = getelementptr inbounds i8, i8* %tmp15, i64 %j.0
47 store i8 %tmp13, i8* %tmp16, align 1
51 %tmp18 = add nuw nsw i64 %j.0, 1
58 %tmp21 = add nuw nsw i64 %i.0, 1