1 ; RUN: opt %loadPolly -polly-canonicalize -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 *restrict A, int *restrict sum) {
5 ; CHECK: #pragma minimal dependence distance: 1
6 ; PINFO: for.cond: Loop is not parallel.
7 ; for (int j = 0; j < 1024; j++)
8 ; CHECK: #pragma minimal dependence distance: 1
9 ; PINFO-NEXT: for.cond1: Loop is not parallel.
10 ; for (int i = j; i < 1024; i++)
11 ; A[i - 3] = A[j] * 2 + A[j] + 2;
14 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
16 define void @f(ptr noalias %A, ptr noalias %sum) {
20 for.cond: ; preds = %for.inc7, %entry
21 %j.0 = phi i32 [ 0, %entry ], [ %inc8, %for.inc7 ]
22 %exitcond1 = icmp ne i32 %j.0, 1024
23 br i1 %exitcond1, label %for.body, label %for.end9
25 for.body: ; preds = %for.cond
28 for.cond1: ; preds = %for.inc, %for.body
29 %i.0 = phi i32 [ %j.0, %for.body ], [ %inc, %for.inc ]
30 %exitcond = icmp ne i32 %i.0, 1024
31 br i1 %exitcond, label %for.body3, label %for.end
33 for.body3: ; preds = %for.cond1
34 %arrayidx = getelementptr inbounds i32, ptr %A, i32 %j.0
35 %tmp = load i32, ptr %arrayidx, align 4
36 %add = mul nsw i32 %tmp, 3
37 %add5 = add nsw i32 %add, 2
38 %sub = add nsw i32 %i.0, -3
39 %arrayidx6 = getelementptr inbounds i32, ptr %A, i32 %sub
40 store i32 %add5, ptr %arrayidx6, align 4
43 for.inc: ; preds = %for.body3
44 %inc = add nsw i32 %i.0, 1
47 for.end: ; preds = %for.cond1
50 for.inc7: ; preds = %for.end
51 %inc8 = add nsw i32 %j.0, 1
54 for.end9: ; preds = %for.cond