1 ; RUN: opt %loadPolly -polly-invariant-load-hoisting=true -polly-print-scops -disable-output < %s | FileCheck %s
3 ; void f(unsigned *restrict I, unsigned *restrict A, unsigned N, unsigned M) {
4 ; for (unsigned i = 0; i < N; i++) {
5 ; unsigned char V = *I;
11 ; FIXME: The truncated value should be a paramter.
12 ; CHECK: Assumed Context:
13 ; CHECK-NEXT: [N, tmp, M] -> { : }
14 ; CHECK-NEXT: Invalid Context:
15 ; CHECK-NEXT: [N, tmp, M] -> { : N < 0 or (N > 0 and tmp >= 128) or (N > 0 and tmp < 0) or (N > 0 and M < 0) }
18 ; CHECK-NEXT: [N, tmp, M] -> { Stmt_if_then[i0] : tmp >= 0 and M > tmp and 0 <= i0 < N };
20 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
22 define void @f(ptr noalias %I, ptr noalias %A, i32 %N, i32 %M) {
26 for.cond: ; preds = %for.inc, %entry
27 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
28 %lftr.wideiv = trunc i64 %indvars.iv to i32
29 %exitcond = icmp ne i32 %lftr.wideiv, %N
30 br i1 %exitcond, label %for.body, label %for.end
32 for.body: ; preds = %for.cond
33 %tmp = load i32, ptr %I, align 4
34 %conv1 = and i32 %tmp, 255
35 %cmp2 = icmp ult i32 %conv1, %M
36 br i1 %cmp2, label %if.then, label %if.end
38 if.then: ; preds = %for.body
39 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
40 %tmp1 = load i32, ptr %arrayidx, align 4
41 %inc = add i32 %tmp1, 1
42 store i32 %inc, ptr %arrayidx, align 4
45 if.end: ; preds = %if.then, %for.body
48 for.inc: ; preds = %if.end
49 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
52 for.end: ; preds = %for.cond