blob: b96762abe3d2d9a731a939dd896e069fd6e501d3 [file] [log] [blame]
Evan Chengf7d87ee2010-05-21 00:43:17 +00001; RUN: llc < %s -march=arm -mcpu=cortex-a8 | FileCheck %s
Evan Cheng62061242010-05-17 19:51:20 +00002; Implementing vld / vst as REG_SEQUENCE eliminates the extra vmov's.
3
4%struct.int16x8_t = type { <8 x i16> }
5%struct.int32x4_t = type { <4 x i32> }
Evan Cheng53c779b2010-05-17 20:57:12 +00006%struct.__neon_int8x8x2_t = type { <8 x i8>, <8 x i8> }
Evan Cheng62061242010-05-17 19:51:20 +00007%struct.__neon_int8x8x3_t = type { <8 x i8>, <8 x i8>, <8 x i8> }
8%struct.__neon_int16x8x2_t = type { <8 x i16>, <8 x i16> }
9%struct.__neon_int32x4x2_t = type { <4 x i32>, <4 x i32> }
10
Rafael Espindola1e819662010-06-17 15:18:27 +000011define void @t1(i16* %i_ptr, i16* %o_ptr, %struct.int32x4_t* nocapture %vT0ptr, %struct.int32x4_t* nocapture %vT1ptr) nounwind {
Evan Cheng62061242010-05-17 19:51:20 +000012entry:
13; CHECK: t1:
14; CHECK: vld1.16
15; CHECK-NOT: vmov d
16; CHECK: vmovl.s16
17; CHECK: vshrn.i32
18; CHECK: vshrn.i32
19; CHECK-NOT: vmov d
20; CHECK-NEXT: vst1.16
21 %0 = getelementptr inbounds %struct.int32x4_t* %vT0ptr, i32 0, i32 0 ; <<4 x i32>*> [#uses=1]
22 %1 = load <4 x i32>* %0, align 16 ; <<4 x i32>> [#uses=1]
23 %2 = getelementptr inbounds %struct.int32x4_t* %vT1ptr, i32 0, i32 0 ; <<4 x i32>*> [#uses=1]
24 %3 = load <4 x i32>* %2, align 16 ; <<4 x i32>> [#uses=1]
25 %4 = bitcast i16* %i_ptr to i8* ; <i8*> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +000026 %5 = tail call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %4, i32 1) ; <<8 x i16>> [#uses=1]
Evan Cheng62061242010-05-17 19:51:20 +000027 %6 = bitcast <8 x i16> %5 to <2 x double> ; <<2 x double>> [#uses=2]
28 %7 = extractelement <2 x double> %6, i32 0 ; <double> [#uses=1]
29 %8 = bitcast double %7 to <4 x i16> ; <<4 x i16>> [#uses=1]
Bob Wilsond58b51e2010-08-20 23:22:43 +000030 %9 = sext <4 x i16> %8 to <4 x i32> ; <<4 x i32>> [#uses=1]
Evan Cheng62061242010-05-17 19:51:20 +000031 %10 = extractelement <2 x double> %6, i32 1 ; <double> [#uses=1]
32 %11 = bitcast double %10 to <4 x i16> ; <<4 x i16>> [#uses=1]
Bob Wilsond58b51e2010-08-20 23:22:43 +000033 %12 = sext <4 x i16> %11 to <4 x i32> ; <<4 x i32>> [#uses=1]
Evan Cheng62061242010-05-17 19:51:20 +000034 %13 = mul <4 x i32> %1, %9 ; <<4 x i32>> [#uses=1]
35 %14 = mul <4 x i32> %3, %12 ; <<4 x i32>> [#uses=1]
36 %15 = tail call <4 x i16> @llvm.arm.neon.vshiftn.v4i16(<4 x i32> %13, <4 x i32> <i32 -12, i32 -12, i32 -12, i32 -12>) ; <<4 x i16>> [#uses=1]
37 %16 = tail call <4 x i16> @llvm.arm.neon.vshiftn.v4i16(<4 x i32> %14, <4 x i32> <i32 -12, i32 -12, i32 -12, i32 -12>) ; <<4 x i16>> [#uses=1]
38 %17 = shufflevector <4 x i16> %15, <4 x i16> %16, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> ; <<8 x i16>> [#uses=1]
39 %18 = bitcast i16* %o_ptr to i8* ; <i8*> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +000040 tail call void @llvm.arm.neon.vst1.v8i16(i8* %18, <8 x i16> %17, i32 1)
Evan Cheng62061242010-05-17 19:51:20 +000041 ret void
42}
43
Rafael Espindola1e819662010-06-17 15:18:27 +000044define void @t2(i16* %i_ptr, i16* %o_ptr, %struct.int16x8_t* nocapture %vT0ptr, %struct.int16x8_t* nocapture %vT1ptr) nounwind {
Evan Cheng62061242010-05-17 19:51:20 +000045entry:
46; CHECK: t2:
47; CHECK: vld1.16
Evan Cheng046fa3f2010-05-28 23:26:21 +000048; CHECK-NOT: vmov
49; CHECK: vld1.16
Evan Chengf7d87ee2010-05-21 00:43:17 +000050; CHECK: vmul.i16
Bob Wilsonffde0802010-09-02 16:00:54 +000051; CHECK: vmul.i16
Evan Chengf7d87ee2010-05-21 00:43:17 +000052; CHECK-NOT: vmov
53; CHECK: vst1.16
Evan Cheng62061242010-05-17 19:51:20 +000054; CHECK: vst1.16
55 %0 = getelementptr inbounds %struct.int16x8_t* %vT0ptr, i32 0, i32 0 ; <<8 x i16>*> [#uses=1]
56 %1 = load <8 x i16>* %0, align 16 ; <<8 x i16>> [#uses=1]
57 %2 = getelementptr inbounds %struct.int16x8_t* %vT1ptr, i32 0, i32 0 ; <<8 x i16>*> [#uses=1]
58 %3 = load <8 x i16>* %2, align 16 ; <<8 x i16>> [#uses=1]
59 %4 = bitcast i16* %i_ptr to i8* ; <i8*> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +000060 %5 = tail call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %4, i32 1) ; <<8 x i16>> [#uses=1]
Evan Cheng62061242010-05-17 19:51:20 +000061 %6 = getelementptr inbounds i16* %i_ptr, i32 8 ; <i16*> [#uses=1]
62 %7 = bitcast i16* %6 to i8* ; <i8*> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +000063 %8 = tail call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %7, i32 1) ; <<8 x i16>> [#uses=1]
Evan Cheng62061242010-05-17 19:51:20 +000064 %9 = mul <8 x i16> %1, %5 ; <<8 x i16>> [#uses=1]
65 %10 = mul <8 x i16> %3, %8 ; <<8 x i16>> [#uses=1]
66 %11 = bitcast i16* %o_ptr to i8* ; <i8*> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +000067 tail call void @llvm.arm.neon.vst1.v8i16(i8* %11, <8 x i16> %9, i32 1)
Evan Cheng62061242010-05-17 19:51:20 +000068 %12 = getelementptr inbounds i16* %o_ptr, i32 8 ; <i16*> [#uses=1]
69 %13 = bitcast i16* %12 to i8* ; <i8*> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +000070 tail call void @llvm.arm.neon.vst1.v8i16(i8* %13, <8 x i16> %10, i32 1)
Evan Cheng62061242010-05-17 19:51:20 +000071 ret void
72}
73
74define <8 x i8> @t3(i8* %A, i8* %B) nounwind {
75; CHECK: t3:
76; CHECK: vld3.8
77; CHECK: vmul.i8
78; CHECK-NOT: vmov
79; CHECK: vst3.8
Bob Wilson7a9ef442010-08-27 17:13:24 +000080 %tmp1 = call %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3.v8i8(i8* %A, i32 1) ; <%struct.__neon_int8x8x3_t> [#uses=2]
Evan Cheng62061242010-05-17 19:51:20 +000081 %tmp2 = extractvalue %struct.__neon_int8x8x3_t %tmp1, 0 ; <<8 x i8>> [#uses=1]
82 %tmp3 = extractvalue %struct.__neon_int8x8x3_t %tmp1, 2 ; <<8 x i8>> [#uses=1]
83 %tmp4 = extractvalue %struct.__neon_int8x8x3_t %tmp1, 1 ; <<8 x i8>> [#uses=1]
84 %tmp5 = sub <8 x i8> %tmp3, %tmp4
85 %tmp6 = add <8 x i8> %tmp2, %tmp3 ; <<8 x i8>> [#uses=1]
86 %tmp7 = mul <8 x i8> %tmp4, %tmp2
Bob Wilson7a9ef442010-08-27 17:13:24 +000087 tail call void @llvm.arm.neon.vst3.v8i8(i8* %B, <8 x i8> %tmp5, <8 x i8> %tmp6, <8 x i8> %tmp7, i32 1)
Evan Cheng62061242010-05-17 19:51:20 +000088 ret <8 x i8> %tmp4
89}
90
Rafael Espindola1e819662010-06-17 15:18:27 +000091define void @t4(i32* %in, i32* %out) nounwind {
Evan Cheng62061242010-05-17 19:51:20 +000092entry:
93; CHECK: t4:
94; CHECK: vld2.32
95; CHECK-NOT: vmov
96; CHECK: vld2.32
97; CHECK-NOT: vmov
98; CHECK: bne
99 %tmp1 = bitcast i32* %in to i8* ; <i8*> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000100 %tmp2 = tail call %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8* %tmp1, i32 1) ; <%struct.__neon_int32x4x2_t> [#uses=2]
Evan Cheng62061242010-05-17 19:51:20 +0000101 %tmp3 = getelementptr inbounds i32* %in, i32 8 ; <i32*> [#uses=1]
102 %tmp4 = bitcast i32* %tmp3 to i8* ; <i8*> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000103 %tmp5 = tail call %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8* %tmp4, i32 1) ; <%struct.__neon_int32x4x2_t> [#uses=2]
Evan Cheng62061242010-05-17 19:51:20 +0000104 %tmp8 = bitcast i32* %out to i8* ; <i8*> [#uses=1]
105 br i1 undef, label %return1, label %return2
106
107return1:
108; CHECK: %return1
109; CHECK-NOT: vmov
110; CHECK-NEXT: vadd.i32
111; CHECK-NEXT: vadd.i32
112; CHECK-NEXT: vst2.32
113 %tmp52 = extractvalue %struct.__neon_int32x4x2_t %tmp2, 0 ; <<4 x i32>> [#uses=1]
114 %tmp57 = extractvalue %struct.__neon_int32x4x2_t %tmp2, 1 ; <<4 x i32>> [#uses=1]
115 %tmp = extractvalue %struct.__neon_int32x4x2_t %tmp5, 0 ; <<4 x i32>> [#uses=1]
116 %tmp39 = extractvalue %struct.__neon_int32x4x2_t %tmp5, 1 ; <<4 x i32>> [#uses=1]
117 %tmp6 = add <4 x i32> %tmp52, %tmp ; <<4 x i32>> [#uses=1]
118 %tmp7 = add <4 x i32> %tmp57, %tmp39 ; <<4 x i32>> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000119 tail call void @llvm.arm.neon.vst2.v4i32(i8* %tmp8, <4 x i32> %tmp6, <4 x i32> %tmp7, i32 1)
Evan Cheng62061242010-05-17 19:51:20 +0000120 ret void
121
122return2:
123; CHECK: %return2
124; CHECK: vadd.i32
Bob Wilson7d247052010-10-08 06:15:13 +0000125; CHECK: vmov q9, q11
Evan Cheng62061242010-05-17 19:51:20 +0000126; CHECK-NOT: vmov
Bob Wilson7d247052010-10-08 06:15:13 +0000127; CHECK: vst2.32 {d16, d17, d18, d19}
Evan Cheng62061242010-05-17 19:51:20 +0000128 %tmp100 = extractvalue %struct.__neon_int32x4x2_t %tmp2, 0 ; <<4 x i32>> [#uses=1]
129 %tmp101 = extractvalue %struct.__neon_int32x4x2_t %tmp5, 1 ; <<4 x i32>> [#uses=1]
130 %tmp102 = add <4 x i32> %tmp100, %tmp101 ; <<4 x i32>> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000131 tail call void @llvm.arm.neon.vst2.v4i32(i8* %tmp8, <4 x i32> %tmp102, <4 x i32> %tmp101, i32 1)
Evan Cheng62061242010-05-17 19:51:20 +0000132 call void @llvm.trap()
133 unreachable
134}
135
136define <8 x i16> @t5(i16* %A, <8 x i16>* %B) nounwind {
137; CHECK: t5:
138; CHECK: vldmia
Bob Wilson7d247052010-10-08 06:15:13 +0000139; CHECK: vmov q9, q8
Evan Cheng62061242010-05-17 19:51:20 +0000140; CHECK-NOT: vmov
Bob Wilson7d247052010-10-08 06:15:13 +0000141; CHECK: vld2.16 {d16[1], d18[1]}, [r0]
Evan Cheng62061242010-05-17 19:51:20 +0000142; CHECK-NOT: vmov
143; CHECK: vadd.i16
144 %tmp0 = bitcast i16* %A to i8* ; <i8*> [#uses=1]
145 %tmp1 = load <8 x i16>* %B ; <<8 x i16>> [#uses=2]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000146 %tmp2 = call %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 1) ; <%struct.__neon_int16x8x2_t> [#uses=2]
Evan Cheng62061242010-05-17 19:51:20 +0000147 %tmp3 = extractvalue %struct.__neon_int16x8x2_t %tmp2, 0 ; <<8 x i16>> [#uses=1]
148 %tmp4 = extractvalue %struct.__neon_int16x8x2_t %tmp2, 1 ; <<8 x i16>> [#uses=1]
149 %tmp5 = add <8 x i16> %tmp3, %tmp4 ; <<8 x i16>> [#uses=1]
150 ret <8 x i16> %tmp5
151}
152
Evan Cheng53c779b2010-05-17 20:57:12 +0000153define <8 x i8> @t6(i8* %A, <8 x i8>* %B) nounwind {
154; CHECK: t6:
155; CHECK: vldr.64
Bob Wilson7d247052010-10-08 06:15:13 +0000156; CHECK: vmov d17, d16
157; CHECK-NEXT: vld2.8 {d16[1], d17[1]}
Evan Cheng53c779b2010-05-17 20:57:12 +0000158 %tmp1 = load <8 x i8>* %B ; <<8 x i8>> [#uses=2]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000159 %tmp2 = call %struct.__neon_int8x8x2_t @llvm.arm.neon.vld2lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 1) ; <%struct.__neon_int8x8x2_t> [#uses=2]
Evan Cheng53c779b2010-05-17 20:57:12 +0000160 %tmp3 = extractvalue %struct.__neon_int8x8x2_t %tmp2, 0 ; <<8 x i8>> [#uses=1]
161 %tmp4 = extractvalue %struct.__neon_int8x8x2_t %tmp2, 1 ; <<8 x i8>> [#uses=1]
162 %tmp5 = add <8 x i8> %tmp3, %tmp4 ; <<8 x i8>> [#uses=1]
163 ret <8 x i8> %tmp5
164}
165
Rafael Espindola1e819662010-06-17 15:18:27 +0000166define void @t7(i32* %iptr, i32* %optr) nounwind {
Evan Cheng53c779b2010-05-17 20:57:12 +0000167entry:
168; CHECK: t7:
169; CHECK: vld2.32
170; CHECK: vst2.32
Bob Wilson7d247052010-10-08 06:15:13 +0000171; CHECK: vld1.32 {d16, d17},
172; CHECK: vmov q9, q8
Evan Cheng53c779b2010-05-17 20:57:12 +0000173; CHECK-NOT: vmov
Bob Wilson7d247052010-10-08 06:15:13 +0000174; CHECK: vuzp.32 q8, q9
Evan Cheng53c779b2010-05-17 20:57:12 +0000175; CHECK: vst1.32
176 %0 = bitcast i32* %iptr to i8* ; <i8*> [#uses=2]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000177 %1 = tail call %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8* %0, i32 1) ; <%struct.__neon_int32x4x2_t> [#uses=2]
Evan Cheng53c779b2010-05-17 20:57:12 +0000178 %tmp57 = extractvalue %struct.__neon_int32x4x2_t %1, 0 ; <<4 x i32>> [#uses=1]
179 %tmp60 = extractvalue %struct.__neon_int32x4x2_t %1, 1 ; <<4 x i32>> [#uses=1]
180 %2 = bitcast i32* %optr to i8* ; <i8*> [#uses=2]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000181 tail call void @llvm.arm.neon.vst2.v4i32(i8* %2, <4 x i32> %tmp57, <4 x i32> %tmp60, i32 1)
182 %3 = tail call <4 x i32> @llvm.arm.neon.vld1.v4i32(i8* %0, i32 1) ; <<4 x i32>> [#uses=1]
Evan Cheng53c779b2010-05-17 20:57:12 +0000183 %4 = shufflevector <4 x i32> %3, <4 x i32> undef, <4 x i32> <i32 0, i32 2, i32 0, i32 2> ; <<4 x i32>> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000184 tail call void @llvm.arm.neon.vst1.v4i32(i8* %2, <4 x i32> %4, i32 1)
Evan Cheng53c779b2010-05-17 20:57:12 +0000185 ret void
186}
187
Evan Cheng44bfdd32010-05-17 22:09:49 +0000188; PR7156
189define arm_aapcs_vfpcc i32 @t8() nounwind {
190; CHECK: t8:
Bob Wilson7d247052010-10-08 06:15:13 +0000191; CHECK: vrsqrte.f32 q8, q8
Evan Cheng44bfdd32010-05-17 22:09:49 +0000192bb.nph55.bb.nph55.split_crit_edge:
193 br label %bb3
194
195bb3: ; preds = %bb3, %bb.nph55.bb.nph55.split_crit_edge
196 br i1 undef, label %bb5, label %bb3
197
198bb5: ; preds = %bb3
199 br label %bb.i25
200
201bb.i25: ; preds = %bb.i25, %bb5
202 %0 = shufflevector <2 x float> undef, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> ; <<4 x float>> [#uses=1]
203 %1 = call <4 x float> @llvm.arm.neon.vrsqrte.v4f32(<4 x float> %0) nounwind ; <<4 x float>> [#uses=1]
204 %2 = fmul <4 x float> %1, undef ; <<4 x float>> [#uses=1]
205 %3 = fmul <4 x float> undef, %2 ; <<4 x float>> [#uses=1]
206 %tmp26.i = bitcast <4 x float> %3 to <2 x double> ; <<2 x double>> [#uses=1]
207 %4 = extractelement <2 x double> %tmp26.i, i32 0 ; <double> [#uses=1]
208 %5 = bitcast double %4 to <2 x float> ; <<2 x float>> [#uses=1]
209 %6 = extractelement <2 x float> %5, i32 1 ; <float> [#uses=1]
210 store float %6, float* undef, align 4
211 br i1 undef, label %bb6, label %bb.i25
212
213bb6: ; preds = %bb.i25
214 br i1 undef, label %bb7, label %bb14
215
216bb7: ; preds = %bb6
217 br label %bb.i49
218
219bb.i49: ; preds = %bb.i49, %bb7
220 br i1 undef, label %bb.i19, label %bb.i49
221
222bb.i19: ; preds = %bb.i19, %bb.i49
223 br i1 undef, label %exit, label %bb.i19
224
225exit: ; preds = %bb.i19
226 unreachable
227
228bb14: ; preds = %bb6
229 ret i32 0
230}
231
Evan Chengc6dcce32010-05-17 23:24:12 +0000232%0 = type { %1, %1, %1, %1 }
233%1 = type { %2 }
234%2 = type { <4 x float> }
235%3 = type { %0, %1 }
236
237; PR7157
238define arm_aapcs_vfpcc float @t9(%0* nocapture, %3* nocapture) nounwind {
239; CHECK: t9:
240; CHECK: vldr.64
Bob Wilson7d247052010-10-08 06:15:13 +0000241; CHECK-NOT: vmov d{{.*}}, d16
242; CHECK: vmov.i32 d17
243; CHECK-NEXT: vstmia r0, {d16, d17}
244; CHECK-NEXT: vstmia r0, {d16, d17}
Evan Chengc6dcce32010-05-17 23:24:12 +0000245 %3 = bitcast double 0.000000e+00 to <2 x float> ; <<2 x float>> [#uses=2]
246 %4 = shufflevector <2 x float> %3, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> ; <<4 x float>> [#uses=1]
247 store <4 x float> %4, <4 x float>* undef, align 16
248 %5 = shufflevector <2 x float> %3, <2 x float> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3> ; <<4 x float>> [#uses=1]
249 store <4 x float> %5, <4 x float>* undef, align 16
250 br label %8
251
252; <label>:6 ; preds = %8
Dan Gohmanee1c8702010-06-24 15:24:03 +0000253 br label %7
Evan Chengc6dcce32010-05-17 23:24:12 +0000254
255; <label>:7 ; preds = %6
256 br label %8
257
258; <label>:8 ; preds = %7, %2
Dan Gohmanee1c8702010-06-24 15:24:03 +0000259 br label %6
Evan Chengc6dcce32010-05-17 23:24:12 +0000260
261; <label>:9 ; preds = %8
262 ret float undef
263
264; <label>:10 ; preds = %6
265 ret float 9.990000e+02
266}
267
Evan Cheng27e48402010-05-18 20:03:28 +0000268; PR7162
269define arm_aapcs_vfpcc i32 @t10() nounwind {
270entry:
271; CHECK: t10:
Bob Wilson7d247052010-10-08 06:15:13 +0000272; CHECK: vmov.i32 q9, #0x3F000000
273; CHECK: vmov d0, d17
274; CHECK: vmla.f32 q8, q8, d0[0]
Evan Cheng27e48402010-05-18 20:03:28 +0000275 %0 = shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>> [#uses=1]
276 %1 = insertelement <4 x float> %0, float undef, i32 1 ; <<4 x float>> [#uses=1]
277 %2 = insertelement <4 x float> %1, float undef, i32 2 ; <<4 x float>> [#uses=1]
278 %3 = insertelement <4 x float> %2, float undef, i32 3 ; <<4 x float>> [#uses=1]
279 %tmp54.i = bitcast <4 x float> %3 to <2 x double> ; <<2 x double>> [#uses=1]
280 %4 = extractelement <2 x double> %tmp54.i, i32 1 ; <double> [#uses=1]
281 %5 = bitcast double %4 to <2 x float> ; <<2 x float>> [#uses=1]
282 %6 = shufflevector <2 x float> %5, <2 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>> [#uses=1]
283 %7 = fmul <4 x float> undef, %6 ; <<4 x float>> [#uses=1]
284 %8 = fadd <4 x float> %7, undef ; <<4 x float>> [#uses=1]
285 %9 = fadd <4 x float> %8, undef ; <<4 x float>> [#uses=1]
286 %10 = shufflevector <4 x float> undef, <4 x float> %9, <4 x i32> <i32 0, i32 1, i32 2, i32 7> ; <<4 x float>> [#uses=1]
287 %11 = fmul <4 x float> %10, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01> ; <<4 x float>> [#uses=1]
288 %12 = shufflevector <4 x float> %11, <4 x float> undef, <4 x i32> <i32 3, i32 undef, i32 undef, i32 undef> ; <<4 x float>> [#uses=1]
289 %13 = shufflevector <4 x float> %12, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>> [#uses=1]
290 %14 = fmul <4 x float> %13, undef ; <<4 x float>> [#uses=1]
291 %15 = fadd <4 x float> undef, %14 ; <<4 x float>> [#uses=1]
292 %16 = shufflevector <4 x float> undef, <4 x float> %15, <4 x i32> <i32 0, i32 1, i32 6, i32 3> ; <<4 x float>> [#uses=1]
293 %17 = fmul <4 x float> %16, undef ; <<4 x float>> [#uses=1]
294 %18 = extractelement <4 x float> %17, i32 2 ; <float> [#uses=1]
295 store float %18, float* undef, align 4
296 br i1 undef, label %exit, label %bb14
297
298exit: ; preds = %bb.i19
299 unreachable
300
301bb14: ; preds = %bb6
302 ret i32 0
303}
304
Jakob Stoklund Olesen34373522010-05-19 20:08:00 +0000305; This test crashes the coalescer because live variables were not updated properly.
306define <8 x i8> @t11(i8* %A1, i8* %A2, i8* %A3, i8* %A4, i8* %A5, i8* %A6, i8* %A7, i8* %A8, i8* %B) nounwind {
Bob Wilson7a9ef442010-08-27 17:13:24 +0000307 %tmp1d = call %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3.v8i8(i8* %A4, i32 1) ; <%struct.__neon_int8x8x3_t> [#uses=1]
Jakob Stoklund Olesen34373522010-05-19 20:08:00 +0000308 %tmp2d = extractvalue %struct.__neon_int8x8x3_t %tmp1d, 0 ; <<8 x i8>> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000309 %tmp1f = call %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3.v8i8(i8* %A6, i32 1) ; <%struct.__neon_int8x8x3_t> [#uses=1]
Jakob Stoklund Olesen34373522010-05-19 20:08:00 +0000310 %tmp2f = extractvalue %struct.__neon_int8x8x3_t %tmp1f, 0 ; <<8 x i8>> [#uses=1]
311 %tmp2bd = add <8 x i8> zeroinitializer, %tmp2d ; <<8 x i8>> [#uses=1]
312 %tmp2abcd = mul <8 x i8> zeroinitializer, %tmp2bd ; <<8 x i8>> [#uses=1]
313 %tmp2ef = sub <8 x i8> zeroinitializer, %tmp2f ; <<8 x i8>> [#uses=1]
314 %tmp2efgh = mul <8 x i8> %tmp2ef, undef ; <<8 x i8>> [#uses=2]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000315 call void @llvm.arm.neon.vst3.v8i8(i8* %A2, <8 x i8> undef, <8 x i8> undef, <8 x i8> %tmp2efgh, i32 1)
Jakob Stoklund Olesen34373522010-05-19 20:08:00 +0000316 %tmp2 = sub <8 x i8> %tmp2efgh, %tmp2abcd ; <<8 x i8>> [#uses=1]
317 %tmp7 = mul <8 x i8> undef, %tmp2 ; <<8 x i8>> [#uses=1]
Bob Wilson7a9ef442010-08-27 17:13:24 +0000318 tail call void @llvm.arm.neon.vst3.v8i8(i8* %B, <8 x i8> undef, <8 x i8> undef, <8 x i8> %tmp7, i32 1)
Jakob Stoklund Olesen34373522010-05-19 20:08:00 +0000319 ret <8 x i8> undef
320}
321
Bob Wilson7a9ef442010-08-27 17:13:24 +0000322declare <4 x i32> @llvm.arm.neon.vld1.v4i32(i8*, i32) nounwind readonly
Evan Cheng53c779b2010-05-17 20:57:12 +0000323
Bob Wilson7a9ef442010-08-27 17:13:24 +0000324declare <8 x i16> @llvm.arm.neon.vld1.v8i16(i8*, i32) nounwind readonly
Evan Cheng62061242010-05-17 19:51:20 +0000325
Evan Cheng62061242010-05-17 19:51:20 +0000326declare <4 x i16> @llvm.arm.neon.vshiftn.v4i16(<4 x i32>, <4 x i32>) nounwind readnone
327
Bob Wilson7a9ef442010-08-27 17:13:24 +0000328declare void @llvm.arm.neon.vst1.v4i32(i8*, <4 x i32>, i32) nounwind
Evan Cheng53c779b2010-05-17 20:57:12 +0000329
Bob Wilson7a9ef442010-08-27 17:13:24 +0000330declare void @llvm.arm.neon.vst1.v8i16(i8*, <8 x i16>, i32) nounwind
Evan Cheng62061242010-05-17 19:51:20 +0000331
Bob Wilson7a9ef442010-08-27 17:13:24 +0000332declare void @llvm.arm.neon.vst3.v8i8(i8*, <8 x i8>, <8 x i8>, <8 x i8>, i32)
333nounwind
Evan Cheng62061242010-05-17 19:51:20 +0000334
Bob Wilson7a9ef442010-08-27 17:13:24 +0000335declare %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3.v8i8(i8*, i32) nounwind readonly
Evan Cheng62061242010-05-17 19:51:20 +0000336
Bob Wilson7a9ef442010-08-27 17:13:24 +0000337declare %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8*, i32) nounwind readonly
Evan Cheng62061242010-05-17 19:51:20 +0000338
Bob Wilson7a9ef442010-08-27 17:13:24 +0000339declare %struct.__neon_int8x8x2_t @llvm.arm.neon.vld2lane.v8i8(i8*, <8 x i8>, <8 x i8>, i32, i32) nounwind readonly
Evan Cheng53c779b2010-05-17 20:57:12 +0000340
Bob Wilson7a9ef442010-08-27 17:13:24 +0000341declare %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2lane.v8i16(i8*, <8 x i16>, <8 x i16>, i32, i32) nounwind readonly
Evan Cheng62061242010-05-17 19:51:20 +0000342
Bob Wilson7a9ef442010-08-27 17:13:24 +0000343declare void @llvm.arm.neon.vst2.v4i32(i8*, <4 x i32>, <4 x i32>, i32) nounwind
Evan Cheng62061242010-05-17 19:51:20 +0000344
Evan Cheng44bfdd32010-05-17 22:09:49 +0000345declare <4 x float> @llvm.arm.neon.vrsqrte.v4f32(<4 x float>) nounwind readnone
346
Evan Cheng62061242010-05-17 19:51:20 +0000347declare void @llvm.trap() nounwind