1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-ast -analyze < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-codegen-isl -S < %s | FileCheck %s -check-prefix=CODEGEN
4 ; void f(int a[], int N, float *P, float *Q) {
6 ; for (i = 0; i < N; ++i)
11 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
13 define void @f(i64* nocapture %a, i64 %N, float * %P, float * %Q) nounwind {
18 %i = phi i64 [ 0, %entry ], [ %i.inc, %bb.backedge ]
19 %brcond = icmp ne float* %P, %Q
20 br i1 %brcond, label %store, label %bb.backedge
23 %scevgep = getelementptr i64, i64* %a, i64 %i
24 store i64 %i, i64* %scevgep
28 %i.inc = add nsw i64 %i, 1
29 %exitcond = icmp eq i64 %i.inc, %N
30 br i1 %exitcond, label %return, label %bb
36 ; CHECK: if (Q >= P + 1) {
37 ; CHECK: for (int c0 = 0; c0 < N; c0 += 1)
38 ; CHECK: Stmt_store(c0);
39 ; CHECK: } else if (P >= Q + 1)
40 ; CHECK: for (int c0 = 0; c0 < N; c0 += 1)
41 ; CHECK: Stmt_store(c0);
44 ; CODEGEN: %[[Pinc:[_a-zA-Z0-9]+]] = getelementptr float, float* %P, i64 1
45 ; CODEGEN-NEXT: icmp uge float* %Q, %[[Pinc]]
46 ; CODEGEN: %[[Qinc:[_a-zA-Z0-9]+]] = getelementptr float, float* %Q, i64 1
47 ; CODEGEN-NEXT: icmp uge float* %P, %[[Qinc]]