1 ; RUN: opt %loadPolly -polly-ast -polly-ast-detect-parallel -analyze < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polyhedral-info -polly-check-parallel -analyze < %s | FileCheck %s -check-prefix=PINFO
4 ; Verify that we won't privatize anything in the outer dimension
6 ; CHECK: #pragma known-parallel
7 ; PINFO: for.cond: Loop is parallel.
8 ; CHECK: for (int c0 = 0; c0 < 2 * n; c0 += 1)
9 ; CHECK: #pragma simd reduction
10 ; PINFO-NEXT: for.cond1: Loop is not parallel.
11 ; CHECK: for (int c1 = 0; c1 <= 1023; c1 += 1)
12 ; CHECK: Stmt_for_body3(c0, c1);
14 ; void foo(int *A, long n) {
15 ; for (long i = 0; i < 2 * n; i++)
16 ; for (long j = 0; j < 1024; j++)
20 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
22 define void @foo(i32* %A, i32 %n) {
26 for.cond: ; preds = %for.inc4, %entry
27 %i.0 = phi i32 [ 0, %entry ], [ %inc5, %for.inc4 ]
28 %mul = shl nsw i32 %n, 1
29 %cmp = icmp slt i32 %i.0, %mul
30 br i1 %cmp, label %for.body, label %for.end6
32 for.body: ; preds = %for.cond
35 for.cond1: ; preds = %for.inc, %for.body
36 %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
37 %exitcond = icmp ne i32 %j.0, 1024
38 br i1 %exitcond, label %for.body3, label %for.end
40 for.body3: ; preds = %for.cond1
41 %arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.0
42 %tmp = load i32, i32* %arrayidx, align 4
43 %add = add nsw i32 %tmp, %i.0
44 store i32 %add, i32* %arrayidx, align 4
47 for.inc: ; preds = %for.body3
48 %inc = add nsw i32 %j.0, 1
51 for.end: ; preds = %for.cond1
54 for.inc4: ; preds = %for.end
55 %inc5 = add nsw i32 %i.0, 1
58 for.end6: ; preds = %for.cond