1 ; RUN: opt %loadPolly -polly-ast -polly-ast-detect-parallel -analyze < %s | FileCheck %s
3 ; CHECK-NOT:#pragma known-parallel reduction
4 ; CHECK: #pragma known-parallel
5 ; CHECK: for (int c0 = 0; c0 <= 2047; c0 += 1)
6 ; CHECK: for (int c1 = 0; c1 <= 1023; c1 += 1)
7 ; CHECK: #pragma simd reduction
8 ; CHECK: for (int c2 = 0; c2 <= 511; c2 += 1)
9 ; CHECK: Stmt_for_body6(c0, c1, c2);
12 ; for (long i = 0; i < 2048; i++)
13 ; for (long j = 0; j < 1024; j++)
14 ; for (long k = 0; k < 512; k++)
18 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
20 define void @rmd3(i32* %A) {
24 for.cond: ; preds = %for.inc10, %entry
25 %i.0 = phi i32 [ 0, %entry ], [ %inc11, %for.inc10 ]
26 %exitcond2 = icmp ne i32 %i.0, 2048
27 br i1 %exitcond2, label %for.body, label %for.end12
29 for.body: ; preds = %for.cond
32 for.cond1: ; preds = %for.inc7, %for.body
33 %j.0 = phi i32 [ 0, %for.body ], [ %inc8, %for.inc7 ]
34 %exitcond1 = icmp ne i32 %j.0, 1024
35 br i1 %exitcond1, label %for.body3, label %for.end9
37 for.body3: ; preds = %for.cond1
40 for.cond4: ; preds = %for.inc, %for.body3
41 %k.0 = phi i32 [ 0, %for.body3 ], [ %inc, %for.inc ]
42 %exitcond = icmp ne i32 %k.0, 512
43 br i1 %exitcond, label %for.body6, label %for.end
45 for.body6: ; preds = %for.cond4
46 %arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.0
47 %tmp = load i32, i32* %arrayidx, align 4
48 %add = add nsw i32 %tmp, %i.0
49 store i32 %add, i32* %arrayidx, align 4
52 for.inc: ; preds = %for.body6
53 %inc = add nsw i32 %k.0, 1
56 for.end: ; preds = %for.cond4
59 for.inc7: ; preds = %for.end
60 %inc8 = add nsw i32 %j.0, 1
63 for.end9: ; preds = %for.cond1
66 for.inc10: ; preds = %for.end9
67 %inc11 = add nsw i32 %i.0, 1
70 for.end12: ; preds = %for.cond