1 ; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa '-passes=print<polly-detect>' -disable-output < %s 2>&1 | FileCheck %s
3 ; void f(long A[], int N, int *init_ptr) {
6 ; for (i = 0; i < N; ++i) {
8 ; for (i = 0; i < N; ++i) {
14 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
16 define void @f(ptr noalias %A, i64 %N, ptr noalias %init_ptr) nounwind {
21 %indvar.i = phi i64 [ 0, %entry ], [ %indvar.i.next, %for.i.end ]
22 %indvar.i.next = add nsw i64 %indvar.i, 1
26 %init = load i64, ptr %init_ptr
30 %indvar.j = phi i64 [ 0, %entry.next ], [ %indvar.j.next, %for.j ]
31 %init_plus_two = add i64 %init, 2
32 %scevgep = getelementptr i64, ptr %A, i64 %indvar.j
33 store i64 %init_plus_two, ptr %scevgep
34 %indvar.j.next = add nsw i64 %indvar.j, 1
35 %exitcond.j = icmp eq i64 %indvar.j.next, %N
36 br i1 %exitcond.j, label %for.i.end, label %for.j
39 %exitcond.i = icmp eq i64 %indvar.i.next, %N
40 br i1 %exitcond.i, label %return, label %for.i
46 ; CHECK: Valid Region for Scop: for.i => return