1 ; RUN: llc -march=hexagon < %s
4 %s.0 = type { i8, i8, ptr, i8, i32, ptr, ptr }
5 %s.1 = type { ptr, %s.2, ptr, %s.2 }
6 %s.2 = type { i8, %s.3, i8 }
8 %s.4 = type { [65 x i8], i16, ptr, ptr }
10 @g0 = private unnamed_addr constant [4 x i8] c"and\00", align 1
11 @g1 = private unnamed_addr constant [3 x i8] c"or\00", align 1
12 @g2 = private unnamed_addr constant [8 x i8] c"implies\00", align 1
13 @g3 = private unnamed_addr constant [3 x i8] c"if\00", align 1
14 @g4 = global [4 x %s.0] [%s.0 { i8 1, i8 38, ptr @g0, i8 1, i32 8, ptr null, ptr null }, %s.0 { i8 2, i8 124, ptr @g1, i8 1, i32 7, ptr null, ptr null }, %s.0 { i8 3, i8 62, ptr @g2, i8 1, i32 1, ptr null, ptr null }, %s.0 { i8 4, i8 60, ptr @g3, i8 1, i32 1, ptr null, ptr null }], align 8
15 @g5 = internal global [64 x i8] zeroinitializer, align 8
16 @g6 = internal unnamed_addr global ptr null, align 4
18 ; Function Attrs: nounwind
21 %v0 = tail call ptr @f1(ptr null) #0
24 b1: ; preds = %b1, %b0
25 %v1 = tail call zeroext i8 @f2(ptr @g5) #0
26 switch i8 %v1, label %b1 [
31 b2: ; preds = %b1, %b1
35 declare ptr @f1(ptr) #0
37 declare zeroext i8 @f2(ptr) #0
39 ; Function Attrs: nounwind
40 define void @f3() #0 {
42 store ptr @g4, ptr @g6, align 4
43 store ptr @g4, ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 0, i32 5), align 8
44 store ptr @g4, ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 0, i32 6), align 4
45 %v0 = load ptr, ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 1, i32 2), align 4
48 b1: ; preds = %b1, %b0
49 %v1 = phi ptr [ @g4, %b0 ], [ %v9, %b1 ]
50 %v2 = getelementptr inbounds %s.0, ptr %v1, i32 0, i32 2
51 %v3 = load ptr, ptr %v2, align 4
52 %v4 = tail call i32 @f4(ptr %v0, ptr %v3) #0
53 %v5 = icmp sgt i32 %v4, 0
54 %v6 = getelementptr inbounds %s.0, ptr %v1, i32 0, i32 5
55 %v7 = getelementptr inbounds %s.0, ptr %v1, i32 0, i32 6
56 %v8 = select i1 %v5, ptr %v6, ptr %v7
57 %v9 = load ptr, ptr %v8, align 4
58 %v10 = icmp eq ptr %v9, null
59 br i1 %v10, label %b2, label %b1
62 %v11 = phi i32 [ %v4, %b1 ]
63 %v12 = phi ptr [ %v1, %b1 ]
64 %v13 = icmp sgt i32 %v11, 0
65 br i1 %v13, label %b3, label %b4
68 %v14 = getelementptr inbounds %s.0, ptr %v12, i32 0, i32 5
69 store ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 1), ptr %v14, align 4
72 b4: ; preds = %b3, %b2
73 %v15 = getelementptr inbounds %s.0, ptr %v12, i32 0, i32 6
74 store ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 1), ptr %v15, align 4
75 %v16 = load ptr, ptr @g6, align 4
76 %v17 = icmp eq ptr %v16, null
77 br i1 %v17, label %b8, label %b5
80 %v18 = load ptr, ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 2, i32 2), align 4
83 b6: ; preds = %b6, %b5
84 %v19 = phi ptr [ %v16, %b5 ], [ %v27, %b6 ]
85 %v20 = getelementptr inbounds %s.0, ptr %v19, i32 0, i32 2
86 %v21 = load ptr, ptr %v20, align 4
87 %v22 = tail call i32 @f4(ptr %v18, ptr %v21) #0
88 %v23 = icmp sgt i32 %v22, 0
89 %v24 = getelementptr inbounds %s.0, ptr %v19, i32 0, i32 5
90 %v25 = getelementptr inbounds %s.0, ptr %v19, i32 0, i32 6
91 %v26 = select i1 %v23, ptr %v24, ptr %v25
92 %v27 = load ptr, ptr %v26, align 4
93 %v28 = icmp eq ptr %v27, null
94 br i1 %v28, label %b7, label %b6
97 %v29 = phi i32 [ %v22, %b6 ]
98 %v30 = phi ptr [ %v19, %b6 ]
101 b8: ; preds = %b7, %b4
102 %v31 = phi i32 [ %v11, %b4 ], [ %v29, %b7 ]
103 %v32 = phi ptr [ null, %b4 ], [ %v30, %b7 ]
104 %v33 = icmp sgt i32 %v31, 0
105 br i1 %v33, label %b9, label %b10
108 %v34 = getelementptr inbounds %s.0, ptr %v32, i32 0, i32 5
109 store ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 2), ptr %v34, align 4
112 b10: ; preds = %b9, %b8
113 %v35 = getelementptr inbounds %s.0, ptr %v32, i32 0, i32 6
114 store ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 2), ptr %v35, align 4
115 %v36 = load ptr, ptr @g6, align 4
116 %v37 = icmp eq ptr %v36, null
117 br i1 %v37, label %b14, label %b11
120 %v38 = load ptr, ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 3, i32 2), align 4
123 b12: ; preds = %b12, %b11
124 %v39 = phi ptr [ %v36, %b11 ], [ %v47, %b12 ]
125 %v40 = getelementptr inbounds %s.0, ptr %v39, i32 0, i32 2
126 %v41 = load ptr, ptr %v40, align 4
127 %v42 = tail call i32 @f4(ptr %v38, ptr %v41) #0
128 %v43 = icmp sgt i32 %v42, 0
129 %v44 = getelementptr inbounds %s.0, ptr %v39, i32 0, i32 5
130 %v45 = getelementptr inbounds %s.0, ptr %v39, i32 0, i32 6
131 %v46 = select i1 %v43, ptr %v44, ptr %v45
132 %v47 = load ptr, ptr %v46, align 4
133 %v48 = icmp eq ptr %v47, null
134 br i1 %v48, label %b13, label %b12
137 %v49 = phi i32 [ %v42, %b12 ]
138 %v50 = phi ptr [ %v39, %b12 ]
141 b14: ; preds = %b13, %b10
142 %v51 = phi i32 [ %v31, %b10 ], [ %v49, %b13 ]
143 %v52 = phi ptr [ null, %b10 ], [ %v50, %b13 ]
144 %v53 = icmp sgt i32 %v51, 0
145 br i1 %v53, label %b15, label %b16
148 %v54 = getelementptr inbounds %s.0, ptr %v52, i32 0, i32 5
149 store ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 3), ptr %v54, align 4
152 b16: ; preds = %b15, %b14
153 %v55 = getelementptr inbounds %s.0, ptr %v52, i32 0, i32 6
154 store ptr getelementptr inbounds ([4 x %s.0], ptr @g4, i32 0, i32 3), ptr %v55, align 4
158 ; Function Attrs: nounwind readonly
159 declare i32 @f4(ptr nocapture, ptr nocapture) #1
161 attributes #0 = { nounwind }
162 attributes #1 = { nounwind readonly }