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 ; void f(int *A, int N) {
5 ; CHECK: #pragma minimal dependence distance: ((N - 1) % 2) + 1
6 ; PINFO: for.cond: Loop is not parallel.
7 ; for (int i = 0; i < N; i++)
11 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
13 define void @f(i32* %A, i32 %N) {
17 for.cond: ; preds = %for.inc, %entry
18 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
19 %cmp = icmp slt i32 %i.0, %N
20 br i1 %cmp, label %for.body, label %for.end
22 for.body: ; preds = %for.cond
23 %sub = sub nsw i32 %N, %i.0
24 %arrayidx = getelementptr inbounds i32, i32* %A, i32 %sub
25 %tmp = load i32, i32* %arrayidx, align 4
26 %add = add nsw i32 %tmp, 1
27 %arrayidx1 = getelementptr inbounds i32, i32* %A, i32 %i.0
28 store i32 %add, i32* %arrayidx1, align 4
31 for.inc: ; preds = %for.body
32 %inc = add nsw i32 %i.0, 1
35 for.end: ; preds = %for.cond