1 ; RUN: opt %loadPolly -polly-detect-unprofitable -basicaa -polly-detect -analyze < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-detect-unprofitable -basicaa -polly-detect -analyze < %s | FileCheck %s
4 ; void f(long A[], int N, int *init_ptr) {
7 ; for (i = 0; i < N; ++i) {
9 ; for (i = 0; i < N; ++i) {
15 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 target triple = "x86_64-unknown-linux-gnu"
18 define void @f(i64* noalias %A, i64 %N, i64* noalias %init_ptr) nounwind {
23 %indvar.i = phi i64 [ 0, %entry ], [ %indvar.i.next, %for.i.end ]
24 %indvar.i.next = add nsw i64 %indvar.i, 1
28 %init = load i64* %init_ptr
32 %indvar.j = phi i64 [ 0, %entry.next ], [ %indvar.j.next, %for.j ]
33 %init_plus_two = add i64 %init, 2
34 %scevgep = getelementptr i64, i64* %A, i64 %indvar.j
35 store i64 %init_plus_two, i64* %scevgep
36 %indvar.j.next = add nsw i64 %indvar.j, 1
37 %exitcond.j = icmp eq i64 %indvar.j.next, %N
38 br i1 %exitcond.j, label %for.i.end, label %for.j
41 %exitcond.i = icmp eq i64 %indvar.i.next, %N
42 br i1 %exitcond.i, label %return, label %for.i
48 ; CHECK: Valid Region for Scop: for.i => return