1 ; RUN: opt %loadPolly -polly-print-ast -polly-ast-detect-parallel -disable-output < %s | FileCheck %s
2 ; RUN: opt %loadPolly -print-polyhedral-info -polly-check-parallel -disable-output < %s | FileCheck %s -check-prefix=PINFO
4 ; void f(int *A, int N, int c) {
5 ; CHECK: #pragma minimal dependence distance: 1
6 ; PINFO: for.cond: Loop is not parallel.
7 ; for (int j = 0; j < N; j++)
8 ; CHECK: #pragma minimal dependence distance: max(-c, c)
9 ; PINFO-NEXT: for.cond1: Loop is not parallel.
10 ; for (int i = 0; i < N; i++)
11 ; A[i + c] = A[i] + 1;
14 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
16 define void @f(ptr %A, i32 %N, i32 %c) {
20 for.cond: ; preds = %for.inc6, %entry
21 %j.0 = phi i32 [ 0, %entry ], [ %inc7, %for.inc6 ]
22 %cmp = icmp slt i32 %j.0, %N
23 br i1 %cmp, label %for.body, label %for.end8
25 for.body: ; preds = %for.cond
28 for.cond1: ; preds = %for.inc, %for.body
29 %i.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
30 %exitcond = icmp ne i32 %i.0, %N
31 br i1 %exitcond, label %for.body3, label %for.end
33 for.body3: ; preds = %for.cond1
34 %arrayidx = getelementptr inbounds i32, ptr %A, i32 %i.0
35 %tmp = load i32, ptr %arrayidx, align 4
36 %add = add nsw i32 %tmp, 1
37 %add4 = add nsw i32 %i.0, %c
38 %arrayidx5 = getelementptr inbounds i32, ptr %A, i32 %add4
39 store i32 %add, ptr %arrayidx5, align 4
42 for.inc: ; preds = %for.body3
43 %inc = add nsw i32 %i.0, 1
46 for.end: ; preds = %for.cond1
49 for.inc6: ; preds = %for.end
50 %inc7 = add nsw i32 %j.0, 1
53 for.end8: ; preds = %for.cond