1 ; RUN: opt %loadPolly -polly-print-scops -polly-invariant-load-hoisting=true -polly-ignore-aliasing -polly-process-unprofitable -disable-output < %s | FileCheck %s
3 ; CHECK: Region: %entry.split---%if.end
4 ; CHECK: Invariant Accesses: {
5 ; CHECK: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
6 ; CHECK: [y, p_1_loaded_from_j] -> { Stmt_for_body[i0] -> MemRef_j[0] };
7 ; CHECK: Execution Context: [y, p_1_loaded_from_j] -> { : }
10 ; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
11 ; CHECK: [y, p_1_loaded_from_j] -> { Stmt_for_body5[i0] -> MemRef_p[p_1_loaded_from_j + i0] };
12 ; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
13 ; CHECK: [y, p_1_loaded_from_j] -> { Stmt_for_body[i0] -> MemRef_p[p_1_loaded_from_j + i0] };
16 define void @a(i32 %y, ptr nocapture %p, ptr nocapture readonly %j) local_unnamed_addr #0 {
21 %tobool = icmp eq i32 %y, 0
22 br i1 %tobool, label %for.body5, label %for.body
25 %i.024 = phi i32 [ %inc, %for.body ], [ 0, %entry.split ]
26 %0 = load i32, ptr %j, align 4
27 %add = add nsw i32 %0, %i.024
28 %idxprom = sext i32 %add to i64
29 %arrayidx = getelementptr inbounds i32, ptr %p, i64 %idxprom
30 store i32 %i.024, ptr %arrayidx, align 4
31 %inc = add nuw nsw i32 %i.024, 1
32 %exitcond26 = icmp eq i32 %inc, 10000
33 br i1 %exitcond26, label %if.end, label %for.body
36 %i1.023 = phi i32 [ %inc10, %for.body5 ], [ 0, %entry.split ]
37 %mul = shl nsw i32 %i1.023, 1
38 %1 = load i32, ptr %j, align 4
39 %add6 = add nsw i32 %1, %i1.023
40 %idxprom7 = sext i32 %add6 to i64
41 %arrayidx8 = getelementptr inbounds i32, ptr %p, i64 %idxprom7
42 store i32 %mul, ptr %arrayidx8, align 4
43 %inc10 = add nuw nsw i32 %i1.023, 1
44 %exitcond = icmp eq i32 %inc10, 10000
45 br i1 %exitcond, label %if.end, label %for.body5