1 ; RUN: llc -march=hexagon -O3 < %s
4 ; Test that the compiler doesn't assert when attempting to find a
5 ; loop instruction that has been deleted, so FindLoopInstr returns
6 ; the loop instruction from a different loop.
8 @g0 = external global i32
10 ; Function Attrs: nounwind
11 define void @f0() #0 {
13 %v0 = alloca i64, align 8
14 %v2 = load i32, ptr @g0, align 4
15 br i1 undef, label %b1, label %b2
17 b1: ; preds = %b1, %b0
18 %v3 = phi i32 [ %v4, %b1 ], [ 64, %b0 ]
19 %v4 = add nsw i32 %v3, 1
20 %v5 = icmp slt i32 %v4, %v2
21 br i1 %v5, label %b1, label %b2
23 b2: ; preds = %b6, %b3, %b1, %b0
27 br i1 undef, label %b4, label %b2
29 b4: ; preds = %b3, %b2
30 %v6 = icmp slt i32 undef, 1
31 br i1 %v6, label %b3, label %b5
33 b5: ; preds = %b5, %b4
34 %v7 = phi i32 [ %v18, %b5 ], [ 1, %b4 ]
35 %v8 = phi i32 [ %v19, %b5 ], [ 0, %b4 ]
36 %v9 = add nsw i32 %v8, 0
37 %v10 = lshr i32 %v9, 5
38 %v11 = getelementptr inbounds [2 x i32], ptr %v0, i32 0, i32 %v10
39 %v12 = load i32, ptr %v11, align 4
40 %v13 = and i32 %v9, 31
41 %v14 = shl i32 1, %v13
42 %v15 = and i32 %v12, %v14
43 %v16 = icmp ne i32 %v15, 0
44 %v17 = zext i1 %v16 to i32
45 %v18 = and i32 %v17, %v7
46 %v19 = add nsw i32 %v8, 1
47 %v20 = icmp eq i32 %v19, 1
48 br i1 %v20, label %b6, label %b5
51 %v21 = icmp eq i32 %v18, 0
52 br i1 %v21, label %b2, label %b7
55 tail call void @f1() #1
59 ; Function Attrs: nounwind
62 attributes #0 = { nounwind "target-cpu"="hexagonv55" }
63 attributes #1 = { nounwind }