1 ; RUN: opt %loadPolly -polly-import-jscop -polly-print-ast -polly-ast-detect-parallel -disable-output < %s | FileCheck %s
3 ; Verify that only the outer dimension needs privatization
5 ; CHECK: #pragma known-parallel reduction
6 ; CHECK: for (int c1 = 0; c1 <= 1023; c1 += 1) {
7 ; CHECK: if ((c1 + 1) % 2 == 0) {
8 ; CHECK-NOT: #pragma simd reduction
10 ; CHECK: for (int c3 = -2 * n + 1; c3 <= 0; c3 += 1)
11 ; CHECK: Stmt_for_body3(-c3, c1);
13 ; CHECK-NOT: #pragma simd reduction
15 ; CHECK: for (int c3 = 0; c3 < 2 * n; c3 += 1)
16 ; CHECK: Stmt_for_body3(c3, c1);
20 ; void rmsmd5(int *A, long n) {
21 ; for (long i = 0; i < 2 * n; i++)
22 ; for (long j = 0; j < 1024; j++)
26 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
28 define void @rmsmd5(ptr %A, i32 %n) {
32 for.cond: ; preds = %for.inc4, %entry
33 %i.0 = phi i32 [ 0, %entry ], [ %inc5, %for.inc4 ]
34 %mul = shl nsw i32 %n, 1
35 %cmp = icmp slt i32 %i.0, %mul
36 br i1 %cmp, label %for.body, label %for.end6
38 for.body: ; preds = %for.cond
41 for.cond1: ; preds = %for.inc, %for.body
42 %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
43 %exitcond = icmp ne i32 %j.0, 1024
44 br i1 %exitcond, label %for.body3, label %for.end
46 for.body3: ; preds = %for.cond1
47 %arrayidx = getelementptr inbounds i32, ptr %A, i32 %i.0
48 %tmp = load i32, ptr %arrayidx, align 4
49 %add = add nsw i32 %tmp, %i.0
50 store i32 %add, ptr %arrayidx, align 4
53 for.inc: ; preds = %for.body3
54 %inc = add nsw i32 %j.0, 1
57 for.end: ; preds = %for.cond1
60 for.inc4: ; preds = %for.end
61 %inc5 = add nsw i32 %i.0, 1
64 for.end6: ; preds = %for.cond