1 ; RUN: llc -march=hexagon < %s | FileCheck %s
8 %s.0 = type { i8*, i32, %s.0* }
10 @g0 = external global %s.0**, align 4
11 @g1 = private global [4 x i64] zeroinitializer, section "__llvm_prf_cnts", align 8
13 declare void @f0(%s.0*)
17 %v0 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @g1, i32 0, i32 0), align 8
19 store i64 %v1, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @g1, i32 0, i32 0), align 8
22 b1: ; preds = %b6, %b0
23 %v2 = phi i32 [ 0, %b0 ], [ %v27, %b6 ]
24 %v3 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @g1, i32 0, i32 1), align 8
26 store i64 %v4, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @g1, i32 0, i32 1), align 8
27 %v5 = load %s.0**, %s.0*** @g0, align 4
28 %v6 = getelementptr inbounds %s.0*, %s.0** %v5, i32 %v2
29 %v7 = load %s.0*, %s.0** %v6, align 4
30 %v8 = icmp eq %s.0* %v7, null
31 br i1 %v8, label %b6, label %b2
34 %v9 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @g1, i32 0, i32 2), align 8
36 store i64 %v10, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @g1, i32 0, i32 2), align 8
37 %v11 = bitcast %s.0* %v7 to %s.0*
38 %v12 = getelementptr inbounds %s.0, %s.0* %v11, i32 0, i32 2
39 %v13 = load %s.0*, %s.0** %v12, align 4
40 %v14 = icmp eq %s.0* %v13, null
41 %v15 = getelementptr inbounds %s.0, %s.0* %v11, i32 0, i32 2
42 br i1 %v14, label %b5, label %b3
47 b4: ; preds = %b4, %b3
48 %v16 = phi %s.0** [ %v25, %b4 ], [ %v15, %b3 ]
49 %v17 = phi %s.0* [ %v20, %b4 ], [ %v7, %b3 ]
50 %v18 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @g1, i32 0, i32 3), align 8
51 %v19 = add i64 %v18, 1
52 store i64 %v19, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @g1, i32 0, i32 3), align 8
53 %v20 = load %s.0*, %s.0** %v16, align 4
54 tail call void @f0(%s.0* %v17)
55 %v21 = bitcast %s.0* %v20 to %s.0*
56 %v22 = getelementptr inbounds %s.0, %s.0* %v21, i32 0, i32 2
57 %v23 = load %s.0*, %s.0** %v22, align 4
58 %v24 = icmp eq %s.0* %v23, null
59 %v25 = getelementptr inbounds %s.0, %s.0* %v21, i32 0, i32 2
60 br i1 %v24, label %b5, label %b4
62 b5: ; preds = %b4, %b2
63 %v26 = phi %s.0* [ %v7, %b2 ], [ %v20, %b4 ]
64 tail call void @f0(%s.0* %v26)
67 b6: ; preds = %b5, %b1
68 %v27 = add nuw nsw i32 %v2, 1
69 %v28 = icmp eq i32 %v27, 3001
70 br i1 %v28, label %b7, label %b1
73 %v29 = load %s.0*, %s.0** bitcast (%s.0*** @g0 to %s.0**), align 4
74 tail call void @f0(%s.0* %v29)
78 attributes #0 = { nounwind "target-cpu"="hexagonv60" }