1 ; RUN: opt %loadPolly -polly-invariant-load-hoisting=true -polly-print-scops -disable-output < %s | FileCheck %s
3 ; void f(int *A, unsigned N) {
4 ; for (unsigned i = 0; i < N; i++)
5 ; A[i / 3] = A[5 * N / 3];
8 ; CHECK: Invariant Accesses: {
9 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
10 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> MemRef_A[o0] : -2 + 5N <= 3o0 <= 5N };
11 ; CHECK-NEXT: Execution Context: [N] -> { : 0 < N <= 1383505805528216371 }
14 ; CHECK: Assumed Context:
15 ; CHECK-NEXT: [N] -> { : }
16 ; CHECK-NEXT: Invalid Context:
17 ; CHECK-NEXT: [N] -> { : N >= 1383505805528216372 }
19 ; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
20 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> MemRef_A[o0] : -2 + i0 <= 3o0 <= i0 };
22 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
24 define void @f(ptr %A, i64 %N) {
28 for.cond: ; preds = %for.inc, %entry
29 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
30 %exitcond = icmp ne i64 %indvars.iv, %N
31 br i1 %exitcond, label %for.body, label %for.end
33 for.body: ; preds = %for.cond
34 %mul = mul nsw i64 %N, 5
35 %div2 = udiv i64 %mul, 3
36 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %div2
37 %load = load i32, ptr %arrayidx2, align 4
38 %div = udiv i64 %indvars.iv, 3
39 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %div
40 store i32 %load, ptr %arrayidx, align 4
43 for.inc: ; preds = %for.body
44 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
47 for.end: ; preds = %for.cond