1 ; RUN: opt %loadPolly -polly-import-jscop -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 ; CHECK-NOT: #pragma simd{{\s*$}}
5 ; CHECK: #pragma simd reduction
6 ; CHECK: Stmt_S0(n - c1)
7 ; CHECK: #pragma simd{{\s*$}}
8 ; CHECK: Stmt_S1(n - c1)
10 ; PINFO: for.cond2: Loop is parallel.
11 ; PINFO-NEXT: for.cond: Loop is not parallel.
13 ; void rlr(int *A, long n) {
14 ; for (long i = 0; i < 2 * n; i++)
16 ; for (long i = 0; i < 2 * n; i++)
20 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
22 define void @rlr(i32* %A, i32 %n) {
26 for.cond: ; preds = %for.inc, %entry
27 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
28 %mul = shl nsw i32 %n, 1
29 %cmp = icmp slt i32 %i.0, %mul
30 br i1 %cmp, label %for.body, label %for.end
32 for.body: ; preds = %for.cond
35 S0: ; preds = %for.body
36 %tmp = load i32, i32* %A, align 4
37 %add = add nsw i32 %tmp, %i.0
38 store i32 %add, i32* %A, align 4
41 for.inc: ; preds = %S0
42 %inc = add nsw i32 %i.0, 1
45 for.end: ; preds = %for.cond
48 for.cond2: ; preds = %for.inc8, %for.end
49 %i1.0 = phi i32 [ 0, %for.end ], [ %inc9, %for.inc8 ]
50 %mul3 = shl nsw i32 %n, 1
51 %cmp4 = icmp slt i32 %i1.0, %mul3
52 br i1 %cmp4, label %for.body5, label %for.end10
54 for.body5: ; preds = %for.cond2
57 S1: ; preds = %for.body5
58 %add6 = add nsw i32 %i1.0, 1
59 %arrayidx7 = getelementptr inbounds i32, i32* %A, i32 %add6
60 store i32 1, i32* %arrayidx7, align 4
63 for.inc8: ; preds = %S1
64 %inc9 = add nsw i32 %i1.0, 1
67 for.end10: ; preds = %for.cond2