1 ; RUN: opt -passes='print<access-info>' -disable-output < %s 2>&1 | FileCheck %s
3 ; Inner loop has a store to invariant address, but LAA does not need to identify
4 ; the store to invariant address, since it is a single store.
6 ; for(; i < itr; i++) {
7 ; for(; j < itr; j++) {
8 ; var1[j] = ++var2[i] + var1[j];
12 ; CHECK: Non vectorizable stores to invariant address were not found in loop.
14 define void @foo(ptr nocapture %var1, ptr nocapture %var2, i32 %itr) #0 {
16 %cmp20 = icmp sgt i32 %itr, 0
17 br i1 %cmp20, label %for.cond1.preheader, label %for.end11
19 for.cond1.preheader: ; preds = %entry, %for.inc9
20 %indvars.iv23 = phi i64 [ %indvars.iv.next24, %for.inc9 ], [ 0, %entry ]
21 %j.022 = phi i32 [ %j.1.lcssa, %for.inc9 ], [ 0, %entry ]
22 %cmp218 = icmp slt i32 %j.022, %itr
23 br i1 %cmp218, label %for.body3.lr.ph, label %for.inc9
25 for.body3.lr.ph: ; preds = %for.cond1.preheader
26 %arrayidx = getelementptr inbounds i32, ptr %var2, i64 %indvars.iv23
27 %0 = sext i32 %j.022 to i64
30 for.body3: ; preds = %for.body3, %for.body3.lr.ph
31 %indvars.iv = phi i64 [ %0, %for.body3.lr.ph ], [ %indvars.iv.next, %for.body3 ]
32 %1 = load i32, ptr %arrayidx, align 4
33 %inc = add nsw i32 %1, 1
34 store i32 %inc, ptr %arrayidx, align 4
35 %arrayidx5 = getelementptr inbounds i32, ptr %var1, i64 %indvars.iv
36 %2 = load i32, ptr %arrayidx5, align 4
37 %add = add nsw i32 %inc, %2
38 store i32 %add, ptr %arrayidx5, align 4
39 %indvars.iv.next = add nsw i64 %indvars.iv, 1
40 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
41 %exitcond = icmp eq i32 %lftr.wideiv, %itr
42 br i1 %exitcond, label %for.inc9, label %for.body3
44 for.inc9: ; preds = %for.body3, %for.cond1.preheader
45 %j.1.lcssa = phi i32 [ %j.022, %for.cond1.preheader ], [ %itr, %for.body3 ]
46 %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
47 %lftr.wideiv25 = trunc i64 %indvars.iv.next24 to i32
48 %exitcond26 = icmp eq i32 %lftr.wideiv25, %itr
49 br i1 %exitcond26, label %for.end11, label %for.cond1.preheader
51 for.end11: ; preds = %for.inc9, %entry