1 ; RUN: opt %loadPolly -polly-codegen-ppcg -polly-acc-dump-code \
2 ; RUN: -polly-acc-use-shared \
3 ; RUN: -disable-output < %s | \
4 ; RUN: FileCheck -check-prefix=CODE %s
8 ; void add(float *A, float alpha) {
9 ; for (long i = 0; i < 32; i++)
10 ; for (long j = 0; j < 10; j++)
16 ; CODE-NEXT: for (int c3 = 0; c3 <= 9; c3 += 1)
17 ; CODE-NEXT: Stmt_bb5(t0, c3);
19 ; CODE-NEXT: write(t0);
21 ; This test case was intended to test code generation for scalars stored
22 ; in shared memory. However, after properly marking the scalar as read-only
23 ; the scalar is not stored any more in shared memory. We still leave this
24 ; test case as documentation if we every forget to mark scalars as read-only.
26 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
28 define void @add(float* %A, float %alpha) {
32 bb2: ; preds = %bb11, %bb
33 %i.0 = phi i64 [ 0, %bb ], [ %tmp12, %bb11 ]
34 %exitcond1 = icmp ne i64 %i.0, 32
35 br i1 %exitcond1, label %bb3, label %bb13
40 bb4: ; preds = %bb8, %bb3
41 %j.0 = phi i64 [ 0, %bb3 ], [ %tmp9, %bb8 ]
42 %exitcond = icmp ne i64 %j.0, 10
43 br i1 %exitcond, label %bb5, label %bb10
46 %tmp = getelementptr inbounds float, float* %A, i64 %i.0
47 %tmp6 = load float, float* %tmp, align 4
48 %tmp7 = fadd float %tmp6, %alpha
49 store float %tmp7, float* %tmp, align 4
53 %tmp9 = add nuw nsw i64 %j.0, 1
60 %tmp12 = add nuw nsw i64 %i.0, 1