1 ; RUN: llc -march=hexagon < %s
4 target triple = "hexagon"
6 %s.0 = type { i8, i8, i8, i8 }
9 %s.3 = type { i32 (...)** }
10 %s.4 = type { i8, i8, i16, i8 }
11 %s.5 = type { i8, %s.0* }
13 @g0 = external hidden global [3 x %s.0], align 8
14 @g1 = external hidden global [3 x %s.0], align 8
15 @g2 = external hidden global [3 x %s.0], align 8
16 @g3 = external hidden global [3 x %s.0], align 8
17 @g4 = external hidden global [3 x %s.0], align 8
18 @g5 = external hidden global [3 x %s.0], align 8
19 @g6 = external hidden global [4 x %s.0], align 8
20 @g7 = external hidden global [3 x %s.0], align 8
21 @g8 = external hidden global [3 x %s.0], align 8
22 @g9 = external hidden global [3 x %s.0], align 8
23 @g10 = external hidden global [4 x %s.0], align 8
24 @g11 = external hidden global [3 x %s.0], align 8
25 @g12 = external hidden global [3 x %s.0], align 8
26 @g13 = external hidden global [4 x %s.0], align 8
27 @g14 = external hidden global [3 x %s.0], align 8
28 @g15 = external hidden global [3 x %s.0], align 8
29 @g16 = external hidden global [3 x %s.0], align 8
30 @g17 = external hidden global [4 x %s.0], align 8
31 @g18 = external hidden global [3 x %s.0], align 8
33 ; Function Attrs: norecurse nounwind optsize ssp
34 define hidden zeroext i8 @f0(%s.1* nocapture readnone %a0, %s.4* readonly %a1, %s.5* %a2, i32 %a3) unnamed_addr #0 align 2 {
36 br i1 undef, label %b4, label %b1
39 %v0 = icmp eq i32 %a3, 1
40 %v1 = select i1 %v0, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g18, i32 0, i32 0), %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g0, i32 0, i32 0)
41 %v2 = icmp eq i32 %a3, 2
42 %v3 = select i1 %v2, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g16, i32 0, i32 0), %s.0* %v1
43 %v4 = icmp eq i32 %a3, 3
44 %v5 = select i1 %v4, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g15, i32 0, i32 0), %s.0* %v3
45 %v6 = icmp eq i32 %a3, 4
46 %v7 = select i1 %v6, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g14, i32 0, i32 0), %s.0* %v5
47 %v8 = icmp eq i32 %a3, 5
48 %v9 = select i1 %v8, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g12, i32 0, i32 0), %s.0* %v7
49 %v10 = icmp eq i32 %a3, 6
50 %v11 = select i1 %v10, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g11, i32 0, i32 0), %s.0* %v9
51 %v12 = icmp eq i32 %a3, 7
52 %v13 = select i1 %v12, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g9, i32 0, i32 0), %s.0* %v11
53 %v14 = icmp eq i32 %a3, 8
54 %v15 = select i1 %v14, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g8, i32 0, i32 0), %s.0* %v13
55 %v16 = icmp eq i32 %a3, 9
56 %v17 = select i1 %v16, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g7, i32 0, i32 0), %s.0* %v15
57 %v18 = icmp eq i32 %a3, 10
58 %v19 = select i1 %v18, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g5, i32 0, i32 0), %s.0* %v17
59 %v20 = icmp eq i32 %a3, 11
60 %v21 = select i1 %v20, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g4, i32 0, i32 0), %s.0* %v19
61 %v22 = icmp eq i32 %a3, 12
62 %v23 = select i1 %v22, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g3, i32 0, i32 0), %s.0* %v21
63 %v24 = icmp eq i32 %a3, 13
64 %v25 = select i1 %v24, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g2, i32 0, i32 0), %s.0* %v23
65 %v26 = select i1 undef, %s.0* getelementptr inbounds ([3 x %s.0], [3 x %s.0]* @g1, i32 0, i32 0), %s.0* %v25
66 %v27 = select i1 undef, %s.0* getelementptr inbounds ([4 x %s.0], [4 x %s.0]* @g17, i32 0, i32 0), %s.0* %v26
67 %v28 = icmp eq i32 %a3, 16
68 %v29 = select i1 %v28, %s.0* getelementptr inbounds ([4 x %s.0], [4 x %s.0]* @g13, i32 0, i32 0), %s.0* %v27
69 %v30 = icmp eq i32 %a3, 17
70 %v31 = select i1 %v30, %s.0* null, %s.0* %v29
71 %v32 = select i1 undef, %s.0* getelementptr inbounds ([4 x %s.0], [4 x %s.0]* @g10, i32 0, i32 0), %s.0* %v31
72 %v33 = select i1 undef, %s.0* getelementptr inbounds ([4 x %s.0], [4 x %s.0]* @g6, i32 0, i32 0), %s.0* %v32
73 %v34 = add i32 %a3, -15
74 %v35 = icmp ult i32 %v34, 2
75 %v36 = select i1 %v35, i8 4, i8 3
76 %v37 = select i1 undef, i8 0, i8 %v36
77 %v38 = select i1 undef, i8 4, i8 %v37
78 br i1 undef, label %b2, label %b3
80 b2: ; preds = %b3, %b1
81 %v39 = phi %s.0* [ undef, %b3 ], [ %v33, %b1 ]
82 %v40 = phi i8 [ undef, %b3 ], [ %v38, %b1 ]
83 %v41 = getelementptr inbounds %s.5, %s.5* %a2, i32 0, i32 1
84 store %s.0* %v39, %s.0** %v41, align 4
85 store i8 %v40, i8* undef, align 4
91 b4: ; preds = %b2, %b0
95 attributes #0 = { norecurse nounwind optsize ssp "target-cpu"="hexagonv55" }