1 ; RUN: opt %loadPolly -polly-print-scops -polly-invariant-load-hoisting=true -disable-output < %s | FileCheck %s
3 ; CHECK: Invariant Accesses: {
4 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
5 ; CHECK-NEXT: [c] -> { Stmt_if_then[i0] -> MemRef_I[0] };
6 ; CHECK-NEXT: Execution Context: [c] -> { : 0 <= c <= 126 }
9 ; void f(int *A, unsigned char c, int *I) {
10 ; for (int i = 0; i < 10; i++)
11 ; if ((signed char)(c + (unsigned char)1) > 0)
15 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
17 define void @f(ptr %A, i8 zeroext %c, ptr %I) {
21 for.cond: ; preds = %for.inc, %entry
22 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
23 %exitcond = icmp ne i64 %indvars.iv, 10
24 br i1 %exitcond, label %for.body, label %for.end
26 for.body: ; preds = %for.cond
28 %cmp3 = icmp sgt i8 %add, 0
29 br i1 %cmp3, label %if.then, label %if.end
31 if.then: ; preds = %for.body
32 %tmp = load i32, ptr %I, align 4
33 %arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
34 %tmp1 = load i32, ptr %arrayidx5, align 4
35 %add6 = add nsw i32 %tmp1, %tmp
36 store i32 %add6, ptr %arrayidx5, align 4
39 if.end: ; preds = %if.then, %for.body
42 for.inc: ; preds = %if.end
43 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
46 for.end: ; preds = %for.cond