1 ; RUN: opt %loadNPMPolly '-passes=polly-import-jscop,polly-codegen' \
2 ; RUN: -S < %s | FileCheck %s
4 ; void non-affine-update(double A[], double C[], double B[]) {
5 ; for (int i = 0; i < 10; i++) {
13 ; Verify that all changed memory access functions are correctly code generated.
14 ; At some point this did not work due to memory access identifiers not being
15 ; unique within non-affine scop statements.
17 ; CHECK: polly.stmt.bb2:
18 ; CHECK: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar, 3
19 ; CHECK: %scevgep = getelementptr i8, ptr %A, i64 %[[offset]]
21 ; CHECK: polly.stmt.bb9:
22 ; CHECK: %polly.access.C{{.*}} = getelementptr double, ptr %C, i64 42
23 ; CHECK: %polly.access.C{{.*}} = getelementptr double, ptr %C, i64 42
25 ; CHECK: polly.stmt.bb5:
26 ; CHECK: %polly.access.B{{.*}} = getelementptr double, ptr %B, i64 113
27 ; CHECK: %polly.access.B{{.*}} = getelementptr double, ptr %B, i64 113
30 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
32 define void @non-affine-update(ptr %A, ptr %C, ptr %B) {
36 bb1: ; preds = %bb14, %bb
37 %indvars.iv = phi i64 [ %indvars.iv.next, %bb14 ], [ 0, %bb ]
38 %exitcond = icmp ne i64 %indvars.iv, 10
39 br i1 %exitcond, label %bb2, label %bb15
42 %tmp = getelementptr inbounds double, ptr %A, i64 %indvars.iv
43 %tmp3 = load double, ptr %tmp, align 8
44 %tmp4 = fcmp ult double %tmp3, 6.000000e+00
45 br i1 %tmp4, label %bb9, label %bb5
48 %tmp6 = getelementptr inbounds double, ptr %B, i64 %indvars.iv
49 %tmp7 = load double, ptr %tmp6, align 8
50 %tmp8 = fadd double %tmp7, 4.200000e+01
51 store double %tmp8, ptr %tmp6, align 8
55 %tmp10 = getelementptr inbounds double, ptr %C, i64 %indvars.iv
56 %tmp11 = load double, ptr %tmp10, align 8
57 %tmp12 = fadd double %tmp11, 3.000000e+00
58 store double %tmp12, ptr %tmp10, align 8
61 bb13: ; preds = %bb9, %bb5
65 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1