1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-canonicalize -polly-ast -polly-ast-detect-parallel -analyze < %s | FileCheck %s
3 ; void f(int *restrict A, int *restrict sum) {
4 ; CHECK: #pragma minimal dependence distance: 1
5 ; for (int j = 0; j < 1024; j++)
6 ; CHECK: #pragma minimal dependence distance: 1
7 ; for (int i = j; i < 1024; i++)
8 ; A[i - 3] = A[j] * 2 + A[j] + 2;
11 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
13 define void @f(i32* noalias %A, i32* noalias %sum) {
17 for.cond: ; preds = %for.inc7, %entry
18 %j.0 = phi i32 [ 0, %entry ], [ %inc8, %for.inc7 ]
19 %exitcond1 = icmp ne i32 %j.0, 1024
20 br i1 %exitcond1, label %for.body, label %for.end9
22 for.body: ; preds = %for.cond
25 for.cond1: ; preds = %for.inc, %for.body
26 %i.0 = phi i32 [ %j.0, %for.body ], [ %inc, %for.inc ]
27 %exitcond = icmp ne i32 %i.0, 1024
28 br i1 %exitcond, label %for.body3, label %for.end
30 for.body3: ; preds = %for.cond1
31 %arrayidx = getelementptr inbounds i32, i32* %A, i32 %j.0
32 %tmp = load i32* %arrayidx, align 4
33 %add = mul nsw i32 %tmp, 3
34 %add5 = add nsw i32 %add, 2
35 %sub = add nsw i32 %i.0, -3
36 %arrayidx6 = getelementptr inbounds i32, i32* %A, i32 %sub
37 store i32 %add5, i32* %arrayidx6, align 4
40 for.inc: ; preds = %for.body3
41 %inc = add nsw i32 %i.0, 1
44 for.end: ; preds = %for.cond1
47 for.inc7: ; preds = %for.end
48 %inc8 = add nsw i32 %j.0, 1
51 for.end9: ; preds = %for.cond