1 ; RUN: opt %loadPolly -polly-print-scops -polly-invariant-load-hoisting=true -disable-output < %s | FileCheck %s
4 ; CHECK: Invariant Accesses: {
5 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
6 ; CHECK-NEXT: [c] -> { Stmt_for_body[i0] -> MemRef_I[-1 + c] };
7 ; CHECK-NEXT: Execution Context: [c] -> { : c > 0 }
10 ; CHECK-NEXT: [c] -> { : -128 <= c <= 127 }
11 ; CHECK-NEXT: Assumed Context:
12 ; CHECK-NEXT: [c] -> { : }
13 ; CHECK-NEXT: Invalid Context:
14 ; CHECK-NEXT: [c] -> { : c <= 0 }
16 ; void f(int *A, int *I, unsigned char c) {
17 ; for (int i = 0; i < 10; i++)
18 ; A[i] += I[c - (char)1];
21 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
23 define void @f(ptr %A, ptr %I, i8 zeroext %c) {
27 for.cond: ; preds = %for.inc, %entry
28 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
29 %exitcond = icmp ne i64 %indvars.iv, 10
30 br i1 %exitcond, label %for.body, label %for.end
32 for.body: ; preds = %for.cond
34 %conv = zext i8 %sub to i64
35 %arrayidx = getelementptr inbounds i32, ptr %I, i64 %conv
36 %tmp = load i32, ptr %arrayidx, align 4
37 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
38 %tmp1 = load i32, ptr %arrayidx2, align 4
39 %add = add nsw i32 %tmp1, %tmp
40 store i32 %add, ptr %arrayidx2, 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