1; RUN: opt %loadPolly -polly-scops -polly-invariant-load-hoisting=true -analyze < %s | FileCheck %s 2; 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 } 7; CHECK-NEXT: } 8; 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) 12; A[i] += I[0]; 13; } 14; 15target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 16 17define void @f(i32* %A, i8 zeroext %c, i32* %I) { 18entry: 19 br label %for.cond 20 21for.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 25 26for.body: ; preds = %for.cond 27 %add = add i8 %c, 1 28 %cmp3 = icmp sgt i8 %add, 0 29 br i1 %cmp3, label %if.then, label %if.end 30 31if.then: ; preds = %for.body 32 %tmp = load i32, i32* %I, align 4 33 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv 34 %tmp1 = load i32, i32* %arrayidx5, align 4 35 %add6 = add nsw i32 %tmp1, %tmp 36 store i32 %add6, i32* %arrayidx5, align 4 37 br label %if.end 38 39if.end: ; preds = %if.then, %for.body 40 br label %for.inc 41 42for.inc: ; preds = %if.end 43 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 44 br label %for.cond 45 46for.end: ; preds = %for.cond 47 ret void 48} 49