1 ; RUN: llc -march=mips < %s
2 ; RUN: llc -march=mips -mattr=+msa,+fp64,+mips32r2 < %s
3 ; RUN: llc -march=mipsel < %s
4 ; RUN: llc -march=mipsel -mattr=+msa,+fp64,+mips32r2 < %s
6 ; This test originally failed to select instructions for extract_vector_elt for
8 ; It should at least successfully build.
10 define void @autogen_SD3997499501(ptr, ptr, ptr, i32, i64, i8) {
12 %A4 = alloca <1 x double>
19 %E = extractelement <16 x i64> <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>, i32 14
20 %Shuff = shufflevector <2 x i1> zeroinitializer, <2 x i1> zeroinitializer, <2 x i32> <i32 1, i32 3>
21 %I = insertelement <4 x i64> zeroinitializer, i64 0, i32 3
22 %Tr = trunc <1 x i64> zeroinitializer to <1 x i8>
23 %Sl = select i1 false, ptr %A1, ptr %A
24 %Cmp = icmp ne <2 x i64> zeroinitializer, zeroinitializer
25 %L5 = load double, ptr %Sl
26 store float -4.374162e+06, ptr %A2
27 %E6 = extractelement <4 x i64> zeroinitializer, i32 3
28 %Shuff7 = shufflevector <4 x i64> zeroinitializer, <4 x i64> %I, <4 x i32> <i32 2, i32 4, i32 6, i32 undef>
29 %I8 = insertelement <2 x i1> %Shuff, i1 false, i32 0
30 %B = ashr <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, <i32 -1, i32 -1, i32 -1, i32 -1>
31 %Sl9 = select i1 false, i32 82299, i32 0
32 %Cmp10 = icmp slt i8 97, %5
35 CF72: ; preds = %CF72, %CF80, %CF78, %BB
36 %L11 = load double, ptr %Sl
37 store double 0.000000e+00, ptr %Sl
38 %E12 = extractelement <2 x i1> zeroinitializer, i32 0
39 br i1 %E12, label %CF72, label %CF80
42 %Shuff13 = shufflevector <2 x i1> zeroinitializer, <2 x i1> zeroinitializer, <2 x i32> <i32 3, i32 1>
43 %I14 = insertelement <2 x i64> zeroinitializer, i64 %4, i32 1
44 %B15 = fadd double %L5, 0.000000e+00
45 %BC = bitcast i32 0 to float
46 %Sl16 = select i1 %E12, float 0xC7957ED940000000, float %BC
47 %Cmp17 = icmp eq i32 136082, 471909
48 br i1 %Cmp17, label %CF72, label %CF77
50 CF77: ; preds = %CF77, %CF80
51 %L18 = load double, ptr %Sl
52 store double 0.000000e+00, ptr %Sl
53 %E19 = extractelement <2 x i1> zeroinitializer, i32 0
54 br i1 %E19, label %CF77, label %CF78
57 %Shuff20 = shufflevector <2 x i1> zeroinitializer, <2 x i1> zeroinitializer, <2 x i32> <i32 1, i32 3>
58 %I21 = insertelement <8 x i1> zeroinitializer, i1 %Cmp10, i32 7
59 %B22 = sdiv <4 x i64> %Shuff7, zeroinitializer
60 %FC = uitofp i8 97 to double
61 %Sl23 = select i1 %Cmp10, <2 x i1> zeroinitializer, <2 x i1> zeroinitializer
62 %L24 = load double, ptr %Sl
63 store float %Sl16, ptr %A2
64 %E25 = extractelement <2 x i1> %Shuff, i32 1
65 br i1 %E25, label %CF72, label %CF76
68 %Shuff26 = shufflevector <4 x i64> zeroinitializer, <4 x i64> %B22, <4 x i32> <i32 undef, i32 undef, i32 0, i32 undef>
69 %I27 = insertelement <4 x i64> zeroinitializer, i64 %E, i32 2
70 %B28 = mul <4 x i64> %I27, zeroinitializer
71 %ZE = zext <8 x i1> zeroinitializer to <8 x i64>
72 %Sl29 = select i1 %Cmp17, float -4.374162e+06, float -4.374162e+06
73 %L30 = load i8, ptr %0
74 store double %L5, ptr %Sl
75 %E31 = extractelement <8 x i1> zeroinitializer, i32 5
78 CF: ; preds = %CF, %CF81, %CF76
79 %Shuff32 = shufflevector <16 x i64> <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>, <16 x i64> <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>, <16 x i32> <i32 8, i32 undef, i32 12, i32 14, i32 16, i32 18, i32 20, i32 22, i32 undef, i32 26, i32 28, i32 30, i32 undef, i32 2, i32 4, i32 6>
80 %I33 = insertelement <8 x i1> zeroinitializer, i1 false, i32 2
81 %BC34 = bitcast <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1> to <4 x float>
82 %Sl35 = select i1 %E12, <2 x i1> %I8, <2 x i1> zeroinitializer
83 %Cmp36 = fcmp oge double 0xC2C3BAE2D5C18360, 0xC2C3BAE2D5C18360
84 br i1 %Cmp36, label %CF, label %CF74
86 CF74: ; preds = %CF74, %CF
87 %L37 = load float, ptr %A2
88 store double 0.000000e+00, ptr %Sl
89 %E38 = extractelement <2 x i1> %Sl23, i32 1
90 br i1 %E38, label %CF74, label %CF75
92 CF75: ; preds = %CF75, %CF82, %CF74
93 %Shuff39 = shufflevector <2 x i1> %Shuff13, <2 x i1> zeroinitializer, <2 x i32> <i32 undef, i32 2>
94 %I40 = insertelement <4 x i64> zeroinitializer, i64 %4, i32 2
95 %Sl41 = select i1 %Cmp10, i32 0, i32 %3
96 %Cmp42 = icmp ne <1 x i64> zeroinitializer, zeroinitializer
97 %L43 = load double, ptr %Sl
99 %E44 = extractelement <2 x i1> %Shuff20, i32 1
100 br i1 %E44, label %CF75, label %CF82
102 CF82: ; preds = %CF75
103 %Shuff45 = shufflevector <2 x i1> %Sl23, <2 x i1> %Sl23, <2 x i32> <i32 2, i32 0>
104 %I46 = insertelement <4 x i64> zeroinitializer, i64 0, i32 0
105 %B47 = sub i64 %E, %E6
106 %Sl48 = select i1 %Cmp10, double %L5, double %L43
107 %Cmp49 = icmp uge i64 %4, %B47
108 br i1 %Cmp49, label %CF75, label %CF81
110 CF81: ; preds = %CF82
111 %L50 = load i8, ptr %0
112 store double %L43, ptr %Sl
113 %E51 = extractelement <4 x i64> %Shuff7, i32 3
114 %Shuff52 = shufflevector <4 x float> %BC34, <4 x float> %BC34, <4 x i32> <i32 2, i32 4, i32 6, i32 0>
115 %I53 = insertelement <2 x i1> %Cmp, i1 %E25, i32 0
116 %B54 = fdiv double %L24, %L43
117 %BC55 = bitcast <4 x i64> zeroinitializer to <4 x double>
118 %Sl56 = select i1 false, i8 %5, i8 97
119 %L57 = load i8, ptr %0
120 store i8 %L50, ptr %0
121 %E58 = extractelement <2 x i1> %Shuff20, i32 1
122 br i1 %E58, label %CF, label %CF73
124 CF73: ; preds = %CF73, %CF81
125 %Shuff59 = shufflevector <2 x i1> %Shuff13, <2 x i1> %Shuff45, <2 x i32> <i32 undef, i32 0>
126 %I60 = insertelement <4 x float> %Shuff52, float -4.374162e+06, i32 0
127 %B61 = mul <4 x i64> %I46, zeroinitializer
128 %Sl63 = select i1 %Cmp10, <1 x i64> zeroinitializer, <1 x i64> zeroinitializer
129 %Cmp64 = icmp ne <2 x i1> %Cmp, %Shuff
130 %L65 = load double, ptr %A1
131 store float -4.374162e+06, ptr %A3
132 %E66 = extractelement <8 x i1> %I21, i32 3
133 br i1 %E66, label %CF73, label %CF79
135 CF79: ; preds = %CF79, %CF73
136 %Shuff67 = shufflevector <8 x i1> %I21, <8 x i1> %I21, <8 x i32> <i32 6, i32 8, i32 10, i32 12, i32 14, i32 0, i32 undef, i32 4>
137 %I68 = insertelement <1 x i1> %Cmp42, i1 %E25, i32 0
138 %B69 = sdiv <16 x i64> <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>, <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>
139 %Sl70 = select i1 %Cmp49, <2 x i1> %Sl23, <2 x i1> %Shuff45
140 %Cmp71 = icmp ne i1 false, false
141 br i1 %Cmp71, label %CF79, label %CF83
143 CF83: ; preds = %CF79
144 store double 0.000000e+00, ptr %Sl
145 store float %BC, ptr %A3
146 store double %Sl48, ptr %Sl
147 store double %FC, ptr %Sl
148 store float %BC, ptr %A3