Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / Ast / dependence_distance_parametric.ll
blob43b38b54e7cfaa3138c39a1cc949a33ccc8bc2c9
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-ast -polly-ast-detect-parallel -analyze < %s | FileCheck %s
3 ;        void f(int *A, int N, int c) {
4 ; CHECK:   #pragma minimal dependence distance: 1
5 ;          for (int j = 0; j < N; j++)
6 ; CHECK:     #pragma minimal dependence distance: c >= 1 ? c : -c
7 ;            for (int i = 0; i < N; i++)
8 ;              A[i + c] = A[i] + 1;
9 ;        }
11 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
13 define void @f(i32* %A, i32 %N, i32 %c) {
14 entry:
15   br label %for.cond
17 for.cond:                                         ; preds = %for.inc6, %entry
18   %j.0 = phi i32 [ 0, %entry ], [ %inc7, %for.inc6 ]
19   %cmp = icmp slt i32 %j.0, %N
20   br i1 %cmp, label %for.body, label %for.end8
22 for.body:                                         ; preds = %for.cond
23   br label %for.cond1
25 for.cond1:                                        ; preds = %for.inc, %for.body
26   %i.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
27   %exitcond = icmp ne i32 %i.0, %N
28   br i1 %exitcond, label %for.body3, label %for.end
30 for.body3:                                        ; preds = %for.cond1
31   %arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.0
32   %tmp = load i32* %arrayidx, align 4
33   %add = add nsw i32 %tmp, 1
34   %add4 = add nsw i32 %i.0, %c
35   %arrayidx5 = getelementptr inbounds i32, i32* %A, i32 %add4
36   store i32 %add, i32* %arrayidx5, align 4
37   br label %for.inc
39 for.inc:                                          ; preds = %for.body3
40   %inc = add nsw i32 %i.0, 1
41   br label %for.cond1
43 for.end:                                          ; preds = %for.cond1
44   br label %for.inc6
46 for.inc6:                                         ; preds = %for.end
47   %inc7 = add nsw i32 %j.0, 1
48   br label %for.cond
50 for.end8:                                         ; preds = %for.cond
51   ret void