1; RUN: llc -march=hexagon -O2 < %s
2; REQUIRES: asserts
3
4target triple = "hexagon"
5
6; Function Attrs: nounwind
7define void @f0(i8* %a0, ...) #0 {
8b0:
9  br i1 undef, label %b1, label %b2
10
11b1:                                               ; preds = %b0
12  unreachable
13
14b2:                                               ; preds = %b2, %b0
15  br i1 undef, label %b2, label %b3
16
17b3:                                               ; preds = %b2
18  br i1 undef, label %b4, label %b5
19
20b4:                                               ; preds = %b3
21  br label %b5
22
23b5:                                               ; preds = %b4, %b3
24  br label %b6
25
26b6:                                               ; preds = %b12, %b5
27  br i1 undef, label %b9, label %b7
28
29b7:                                               ; preds = %b6
30  %v0 = load i8, i8* undef, align 1, !tbaa !0
31  %v1 = zext i8 %v0 to i32
32  br i1 undef, label %b9, label %b8
33
34b8:                                               ; preds = %b7
35  br i1 undef, label %b9, label %b10
36
37b9:                                               ; preds = %b8, %b7, %b6
38  br label %b10
39
40b10:                                              ; preds = %b9, %b8
41  %v2 = phi i32 [ undef, %b9 ], [ %v1, %b8 ]
42  %v3 = icmp eq i32 %v2, 37
43  %v4 = sext i1 %v3 to i32
44  %v5 = icmp slt i32 0, 1
45  br i1 %v5, label %b12, label %b11
46
47b11:                                              ; preds = %b10
48  unreachable
49
50b12:                                              ; preds = %b10
51  br i1 undef, label %b13, label %b6
52
53b13:                                              ; preds = %b12
54  br label %b14
55
56b14:                                              ; preds = %b15, %b13
57  br i1 undef, label %b16, label %b15
58
59b15:                                              ; preds = %b14
60  br i1 undef, label %b14, label %b16
61
62b16:                                              ; preds = %b15, %b14
63  br label %b17
64
65b17:                                              ; preds = %b18, %b16
66  %v6 = phi i8* [ undef, %b16 ], [ %v7, %b18 ]
67  %v7 = getelementptr inbounds i8, i8* %v6, i32 1
68  %v8 = load i8, i8* %v7, align 1, !tbaa !0
69  br label %b18
70
71b18:                                              ; preds = %b19, %b17
72  %v9 = phi i32 [ 5, %b17 ], [ %v11, %b19 ]
73  %v10 = icmp eq i8 undef, %v8
74  br i1 %v10, label %b17, label %b19
75
76b19:                                              ; preds = %b18
77  %v11 = add i32 %v9, -1
78  %v12 = icmp eq i32 %v11, 0
79  br i1 %v12, label %b20, label %b18
80
81b20:                                              ; preds = %b19
82  unreachable
83}
84
85attributes #0 = { nounwind }
86
87!0 = !{!1, !1, i64 0}
88!1 = !{!"omnipotent char", !2, i64 0}
89!2 = !{!"Simple C/C++ TBAA"}
90