1 ; RUN: opt %loadPolly -polly-print-ast -disable-output < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s -check-prefix=CODEGEN
4 ; void f(int a[], int N, float *P) {
6 ; for (i = 0; i < N; ++i)
11 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"
13 define void @f(ptr nocapture %a, i64 %N, ptr %P) nounwind {
18 %i = phi i64 [ 0, %entry ], [ %i.inc, %bb.backedge ]
19 %brcond = icmp ne ptr %P, null
20 br i1 %brcond, label %store, label %bb.backedge
23 %scevgep = getelementptr i64, ptr %a, i64 %i
24 store i64 %i, ptr %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 (P <= -1 || P >= 1)
37 ; CHECK-NEXT: for (int c0 = 0; c0 < N; c0 += 1)
38 ; CHECK-NEXT: Stmt_store(c0);
40 ; CODEGEN-LABEL: polly.cond:
41 ; CODEGEN-NEXT: %[[R1:[0-9]*]] = ptrtoint ptr %P to i64
42 ; CODEGEN-NEXT: %[[R2:[0-9]*]] = icmp sle i64 %[[R1]], -1
43 ; CODEGEN-NEXT: %[[R3:[0-9]*]] = ptrtoint ptr %P to i64
44 ; CODEGEN-NEXT: %[[R4:[0-9]*]] = icmp sge i64 %[[R3]], 1
45 ; CODEGEN-NEXT: %[[R5:[0-9]*]] = or i1 %[[R2]], %[[R4]]
46 ; CODEGEN-NEXT: br i1 %[[R5]]