1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; void f(char *A, short N) {
4 ; for (char i = 0; i < (char)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 <= -129 or N >= 128 }
15 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] : 0 <= i0 < N };
17 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
19 define void @f(ptr %A, i16 signext %N) {
23 for.cond: ; preds = %for.inc, %entry
24 %i.0 = phi i8 [ 0, %entry ], [ %inc4, %for.inc ]
25 %conv = sext i8 %i.0 to i32
26 %conv1 = zext i16 %N to i32
27 %sext = shl i32 %conv1, 24
28 %conv2 = ashr exact i32 %sext, 24
29 %cmp = icmp slt i32 %conv, %conv2
30 br i1 %cmp, label %for.body, label %for.end
32 for.body: ; preds = %for.cond
33 %idxprom = sext i8 %i.0 to i64
34 %arrayidx = getelementptr inbounds i8, ptr %A, i64 %idxprom
35 %tmp = load i8, ptr %arrayidx, align 1
37 store i8 %inc, ptr %arrayidx, align 1
40 for.inc: ; preds = %for.body
41 %inc4 = add nsw i8 %i.0, 1
44 for.end: ; preds = %for.cond