1 ; RUN: opt %loadPolly -polly-invariant-load-hoisting=true -polly-print-scops -disable-output < %s | FileCheck %s
3 ; void f(unsigned long *restrict I, unsigned *restrict A, unsigned N) {
4 ; for (unsigned i = 0; i < N; i++) {
11 ; CHECK: Assumed Context:
12 ; CHECK-NEXT: [N, tmp] -> { : }
13 ; CHECK-NEXT: Invalid Context:
14 ; CHECK-NEXT: [N, tmp] -> { : N > 0 and (tmp < 0 or tmp >= 2147483648) }
17 ; CHECK-NEXT: [N, tmp] -> { Stmt_if_then[i0] : tmp >= 0 and tmp < i0 < N };
19 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
21 define void @f(ptr noalias %I, ptr noalias %A, i32 %N, i32 %M) {
25 for.cond: ; preds = %for.inc, %entry
26 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
27 %lftr.wideiv = trunc i64 %indvars.iv to i32
28 %exitcond = icmp ne i32 %lftr.wideiv, %N
29 br i1 %exitcond, label %for.body, label %for.end
31 for.body: ; preds = %for.cond
32 %tmp = load i64, ptr %I, align 8
33 %conv = trunc i64 %tmp to i32
34 %tmp1 = zext i32 %conv to i64
35 %cmp1 = icmp ult i64 %tmp1, %indvars.iv
36 br i1 %cmp1, label %if.then, label %if.end
38 if.then: ; preds = %for.body
39 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
40 %tmp2 = load i32, ptr %arrayidx, align 4
41 %inc = add i32 %tmp2, 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