1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; void f(char *A, short N) {
4 ; for (short i = 0; i < N; i++)
8 ; FIXME: We should the truncate precisely... or just make it a separate parameter.
9 ; CHECK: Assumed Context:
10 ; CHECK-NEXT: [N] -> { : }
11 ; CHECK-NEXT: Invalid Context:
12 ; CHECK-NEXT: [N] -> { : N >= 128 }
14 ; CHECK: ReadAccess := [Reduction Type: +] [Scalar: 0]
15 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> MemRef_A[N] };
16 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: +] [Scalar: 0]
17 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> MemRef_A[N] };
19 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
21 define void @f(ptr %A, i16 signext %N) {
25 for.cond: ; preds = %for.inc, %entry
26 %indvars.iv = phi i16 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
27 %cmp = icmp slt i16 %indvars.iv, %N
28 br i1 %cmp, label %for.body, label %for.end
30 for.body: ; preds = %for.cond
31 %idxprom = trunc i16 %N to i8
32 %arrayidx = getelementptr inbounds i8, ptr %A, i8 %idxprom
33 %tmp1 = load i8, ptr %arrayidx, align 1
34 %inc = add i8 %tmp1, 1
35 store i8 %inc, ptr %arrayidx, align 1
38 for.inc: ; preds = %for.body
39 %indvars.iv.next = add nuw nsw i16 %indvars.iv, 1
42 for.end: ; preds = %for.cond