1 ; RUN: llc -march=hexagon -mcpu=hexagonv5 -enable-pipeliner=0 < %s | FileCheck %s
3 ; Generate loop1 instruction for double loop sequence.
5 ; CHECK: loop1(.LBB{{.}}_{{.}},#100)
6 ; CHECK: loop0(.LBB{{.}}_{{.}},#100)
10 define i32 @main() #0 {
12 %array = alloca [100 x i32], align 8
13 %doublearray = alloca [100 x [100 x i32]], align 8
14 call void @llvm.lifetime.start.p0(i64 400, ptr %array) #1
15 call void @llvm.lifetime.start.p0(i64 40000, ptr %doublearray) #1
16 %arrayidx1 = getelementptr inbounds [100 x [100 x i32]], ptr %doublearray, i32 0, i32 10, i32 10
20 %0 = phi i32 [ undef, %entry ], [ %.pre, %for.body.for.body_crit_edge ]
21 %sum.031 = phi i32 [ undef, %entry ], [ %add, %for.body.for.body_crit_edge ]
22 %arrayidx2.phi = phi ptr [ %array, %entry ], [ %arrayidx2.inc, %for.body.for.body_crit_edge ]
23 %i.030 = phi i32 [ 1, %entry ], [ %phitmp, %for.body.for.body_crit_edge ]
24 %add = add nsw i32 %0, %sum.031
25 %exitcond33 = icmp eq i32 %i.030, 100
26 %arrayidx2.inc = getelementptr i32, ptr %arrayidx2.phi, i32 1
27 br i1 %exitcond33, label %for.cond7.preheader.preheader, label %for.body.for.body_crit_edge
29 for.cond7.preheader.preheader:
30 br label %for.cond7.preheader
32 for.body.for.body_crit_edge:
33 %.pre = load i32, ptr %arrayidx2.inc, align 4
34 %phitmp = add i32 %i.030, 1
38 %i.129 = phi i32 [ %inc16, %for.inc15 ], [ 0, %for.cond7.preheader.preheader ]
42 %j.028 = phi i32 [ 0, %for.cond7.preheader ], [ %inc13, %for.body9 ]
43 %arrayidx11 = getelementptr inbounds [100 x [100 x i32]], ptr %doublearray, i32 0, i32 %i.129, i32 %j.028
44 store i32 %add, ptr %arrayidx11, align 4
45 %inc13 = add nsw i32 %j.028, 1
46 %exitcond = icmp eq i32 %inc13, 100
47 br i1 %exitcond, label %for.inc15, label %for.body9
50 %inc16 = add nsw i32 %i.129, 1
51 %exitcond32 = icmp eq i32 %inc16, 100
52 br i1 %exitcond32, label %for.end17, label %for.cond7.preheader
55 %1 = load i32, ptr %arrayidx1, align 8
56 call void @llvm.lifetime.end.p0(i64 40000, ptr %doublearray) #1
57 call void @llvm.lifetime.end.p0(i64 400, ptr %array) #1
61 declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
63 declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1