1 ; RUN: opt %loadPolly -polly-print-ast -disable-output < %s | FileCheck %s --check-prefix=AST
2 ; RUN: opt %loadPolly -S -polly-codegen < %s | FileCheck %s
4 ; void jd(int *A, int c) {
5 ; for (int i = 0; i < 1024; i++) {
13 ; AST: for (int c0 = 0; c0 <= 1023; c0 += 1) {
14 ; AST: if (c <= -1 || c >= 1) {
15 ; AST: Stmt_if_then(c0);
17 ; AST: Stmt_if_else(c0);
18 ; AST: Stmt_if_end(c0);
22 ; CHECK-NEXT: %phi.phiops = alloca i32
23 ; CHECK-LABEL: polly.stmt.if.end:
24 ; CHECK-NEXT: %phi.phiops.reload = load i32, ptr %phi.phiops
26 ; CHECK-NEXT: store i32 %phi.phiops.reload, ptr
27 ; CHECK-LABEL: polly.stmt.if.then:
28 ; CHECK-NEXT: store i32 1, ptr %phi.phiops
29 ; CHECK-NEXT: br label %polly.merge{{[.]?}}
30 ; CHECK-LABEL: polly.stmt.if.else:
31 ; CHECK-NEXT: store i32 2, ptr %phi.phiops
32 ; CHECK-NEXT: br label %polly.merge{{[.]?}}
34 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
36 define void @jd(ptr %A, i32 %c) {
41 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
42 %exitcond = icmp ne i64 %indvars.iv, 1024
43 br i1 %exitcond, label %for.body, label %for.end
46 %tobool = icmp eq i32 %c, 0
47 br i1 %tobool, label %if.else, label %if.then
56 %phi = phi i32 [ 1, %if.then], [ 2, %if.else ]
57 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
58 store i32 %phi, ptr %arrayidx, align 4
62 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1