1; RUN: opt %loadPolly -polly-scops -polly-invariant-load-hoisting=true -polly-ignore-aliasing -polly-process-unprofitable -analyze < %s | FileCheck %s
2;
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] -> {  :  }
8; CHECK:     }
9
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] };
14
15
16define void @a(i32 %y, i32* nocapture %p, i32* nocapture readonly %j) local_unnamed_addr #0 {
17entry:
18  br label %entry.split
19
20entry.split:
21  %tobool = icmp eq i32 %y, 0
22  br i1 %tobool, label %for.body5, label %for.body
23
24for.body:
25  %i.024 = phi i32 [ %inc, %for.body ], [ 0, %entry.split ]
26  %0 = load i32, i32* %j, align 4
27  %add = add nsw i32 %0, %i.024
28  %idxprom = sext i32 %add to i64
29  %arrayidx = getelementptr inbounds i32, i32* %p, i64 %idxprom
30  store i32 %i.024, i32* %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
34
35for.body5:
36  %i1.023 = phi i32 [ %inc10, %for.body5 ], [ 0, %entry.split ]
37  %mul = shl nsw i32 %i1.023, 1
38  %1 = load i32, i32* %j, align 4
39  %add6 = add nsw i32 %1, %i1.023
40  %idxprom7 = sext i32 %add6 to i64
41  %arrayidx8 = getelementptr inbounds i32, i32* %p, i64 %idxprom7
42  store i32 %mul, i32* %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
46
47if.end:
48  ret void
49}
50
51