1 ; RUN: opt %loadPolly -polly-import-jscop \
2 ; RUN: -polly-import-jscop-postfix=transformed -polly-codegen \
3 ; RUN: < %s -S | FileCheck %s
5 ; CHECK-LABEL: polly.stmt.loop1:
6 ; CHECK-NEXT: %3 = mul nsw i64 5, %polly.indvar{{[0-9]*}}
7 ; CHECK-NEXT: %4 = sub nsw i64 %3, 10
8 ; CHECK-NEXT: %polly.access.A = getelementptr double, ptr %A, i64 %4
9 ; CHECK-NEXT: store double 4.200000e+01, ptr %polly.access.A, align 8
11 ; CHECK-LABEL: polly.stmt.loop2:
12 ; CHECK-NEXT: %polly.access.A[[Num0:[0-9]*]] = getelementptr double, ptr %A, i64 42
13 ; CHECK-NEXT: %val_p_scalar_ = load double, ptr %polly.access.A[[Num0]], align 8
15 ; CHECK-LABEL: polly.stmt.loop3:
16 ; CHECK-NEXT: %val.s2a.reload = load double, ptr %val.s2a
17 ; CHECK-NEXT: [[REG0:%.*]] = mul nsw i64 13, %polly.indvar{{[0-9]*}}
18 ; CHECK-NEXT: [[REG1:%.*]] = add nsw i64 [[REG0]], 5
19 ; CHECK-NEXT: %polly.access.A[[Num1:[0-9]*]] = getelementptr double, ptr %A, i64 [[REG1]]
20 ; CHECK-NEXT: store double %val.s2a.reload, ptr %polly.access.A[[Num1]], align 8,
22 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
24 define void @update_access_functions(i64 %arg, ptr %A) {
29 %indvar = phi i64 [ %indvar.next, %loop1 ], [ 1, %bb3 ]
30 %ptr1 = getelementptr inbounds double, ptr %A, i64 %indvar
31 store double 42.0, ptr %ptr1, align 8
32 %indvar.next = add nuw nsw i64 %indvar, 1
33 %cmp = icmp ne i64 %indvar.next, %arg
34 br i1 %cmp, label %loop1, label %loop2
37 %indvar.2 = phi i64 [ %indvar.2.next, %loop2 ], [ 1, %loop1 ]
38 %ptr2 = getelementptr inbounds double, ptr %A, i64 %indvar.2
39 %val = load double, ptr %ptr2, align 8
40 %indvar.2.next = add nuw nsw i64 %indvar.2, 1
41 %cmp.2 = icmp ne i64 %indvar.2.next, %arg
42 br i1 %cmp.2, label %loop2, label %loop3
45 %indvar.3 = phi i64 [ %indvar.3.next, %loop3 ], [ 1, %loop2 ]
46 %ptr3 = getelementptr inbounds double, ptr %A, i64 %indvar.3
47 store double %val, ptr %ptr3, align 8
48 %indvar.3.next = add nuw nsw i64 %indvar.3, 1
49 %cmp.3 = icmp ne i64 %indvar.3.next, %arg
50 br i1 %cmp.3, label %loop3, label %exit