1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-ast -polly-ast-detect-parallel -analyze < %s | FileCheck %s
3 ; void f(int *A, int N) {
4 ; CHECK: #pragma minimal dependence distance: ((N - 1) % 2) + 1
5 ; for (int i = 0; i < N; i++)
9 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
11 define void @f(i32* %A, i32 %N) {
15 for.cond: ; preds = %for.inc, %entry
16 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
17 %cmp = icmp slt i32 %i.0, %N
18 br i1 %cmp, label %for.body, label %for.end
20 for.body: ; preds = %for.cond
21 %sub = sub nsw i32 %N, %i.0
22 %arrayidx = getelementptr inbounds i32, i32* %A, i32 %sub
23 %tmp = load i32* %arrayidx, align 4
24 %add = add nsw i32 %tmp, 1
25 %arrayidx1 = getelementptr inbounds i32, i32* %A, i32 %i.0
26 store i32 %add, i32* %arrayidx1, align 4
29 for.inc: ; preds = %for.body
30 %inc = add nsw i32 %i.0, 1
33 for.end: ; preds = %for.cond