1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instcombine -mtriple=x86_64-unknown-unknown -S | FileCheck %s
8 define <2 x i64> @test_extrq_call(<2 x i64> %x, <16 x i8> %y) {
9 ; CHECK-LABEL: @test_extrq_call(
10 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) #[[ATTR1:[0-9]+]]
11 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
13 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> %x, <16 x i8> %y) nounwind
17 define <2 x i64> @test_extrq_zero_arg0(<2 x i64> %x, <16 x i8> %y) {
18 ; CHECK-LABEL: @test_extrq_zero_arg0(
19 ; CHECK-NEXT: ret <2 x i64> <i64 0, i64 undef>
21 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> zeroinitializer, <16 x i8> %y) nounwind
25 define <2 x i64> @test_extrq_zero_arg1(<2 x i64> %x, <16 x i8> %y) {
26 ; CHECK-LABEL: @test_extrq_zero_arg1(
27 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[X:%.*]] to <16 x i8>
28 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <16 x i8> [[TMP1]], <16 x i8> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
29 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64>
30 ; CHECK-NEXT: ret <2 x i64> [[TMP3]]
32 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> %x, <16 x i8> zeroinitializer) nounwind
36 define <2 x i64> @test_extrq_to_extqi(<2 x i64> %x, <16 x i8> %y) {
37 ; CHECK-LABEL: @test_extrq_to_extqi(
38 ; CHECK-NEXT: [[TMP1:%.*]] = call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> [[X:%.*]], i8 8, i8 15)
39 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
41 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> %x, <16 x i8> <i8 8, i8 15, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>) nounwind
45 define <2 x i64> @test_extrq_constant(<2 x i64> %x, <16 x i8> %y) {
46 ; CHECK-LABEL: @test_extrq_constant(
47 ; CHECK-NEXT: ret <2 x i64> <i64 255, i64 undef>
49 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> <i64 -1, i64 55>, <16 x i8> <i8 8, i8 15, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>) nounwind
53 define <2 x i64> @test_extrq_constant_undef(<2 x i64> %x, <16 x i8> %y) {
54 ; CHECK-LABEL: @test_extrq_constant_undef(
55 ; CHECK-NEXT: ret <2 x i64> <i64 65535, i64 undef>
57 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> <i64 -1, i64 undef>, <16 x i8> <i8 16, i8 15, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>) nounwind
61 define <2 x i64> @test_extrq_call_constexpr(<2 x i64> %x) {
62 ; CHECK-LABEL: @test_extrq_call_constexpr(
63 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[X:%.*]] to <16 x i8>
64 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <16 x i8> [[TMP1]], <16 x i8> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
65 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64>
66 ; CHECK-NEXT: ret <2 x i64> [[TMP3]]
68 %1 = call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> %x, <16 x i8> bitcast (<2 x i64> <i64 0, i64 undef> to <16 x i8>))
76 define <2 x i64> @test_extrqi_call(<2 x i64> %x) {
77 ; CHECK-LABEL: @test_extrqi_call(
78 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> [[X:%.*]], i8 8, i8 23)
79 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
81 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> %x, i8 8, i8 23)
85 define <2 x i64> @test_extrqi_shuffle_1zuu(<2 x i64> %x) {
86 ; CHECK-LABEL: @test_extrqi_shuffle_1zuu(
87 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[X:%.*]] to <16 x i8>
88 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <16 x i8> [[TMP1]], <16 x i8> <i8 poison, i8 poison, i8 poison, i8 poison, i8 0, i8 0, i8 0, i8 0, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison>, <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 20, i32 21, i32 22, i32 23, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
89 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64>
90 ; CHECK-NEXT: ret <2 x i64> [[TMP3]]
92 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> %x, i8 32, i8 32)
96 define <2 x i64> @test_extrqi_shuffle_2zzzzzzzuuuuuuuu(<2 x i64> %x) {
97 ; CHECK-LABEL: @test_extrqi_shuffle_2zzzzzzzuuuuuuuu(
98 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[X:%.*]] to <16 x i8>
99 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <16 x i8> [[TMP1]], <16 x i8> <i8 poison, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison>, <16 x i32> <i32 2, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
100 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64>
101 ; CHECK-NEXT: ret <2 x i64> [[TMP3]]
103 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> %x, i8 8, i8 16)
107 define <2 x i64> @test_extrqi_undef(<2 x i64> %x) {
108 ; CHECK-LABEL: @test_extrqi_undef(
109 ; CHECK-NEXT: ret <2 x i64> undef
111 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> zeroinitializer, i8 32, i8 33)
115 define <2 x i64> @test_extrqi_zero(<2 x i64> %x) {
116 ; CHECK-LABEL: @test_extrqi_zero(
117 ; CHECK-NEXT: ret <2 x i64> <i64 0, i64 undef>
119 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> zeroinitializer, i8 3, i8 18)
123 define <2 x i64> @test_extrqi_constant(<2 x i64> %x) {
124 ; CHECK-LABEL: @test_extrqi_constant(
125 ; CHECK-NEXT: ret <2 x i64> <i64 7, i64 undef>
127 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> <i64 -1, i64 55>, i8 3, i8 18)
131 define <2 x i64> @test_extrqi_constant_undef(<2 x i64> %x) {
132 ; CHECK-LABEL: @test_extrqi_constant_undef(
133 ; CHECK-NEXT: ret <2 x i64> <i64 15, i64 undef>
135 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> <i64 -1, i64 undef>, i8 4, i8 18)
139 define <2 x i64> @test_extrqi_call_constexpr() {
140 ; CHECK-LABEL: @test_extrqi_call_constexpr(
141 ; CHECK-NEXT: ret <2 x i64> zeroinitializer
143 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> bitcast (<16 x i8> trunc (<16 x i16> bitcast (<4 x i64> <i64 0, i64 undef, i64 2, i64 undef> to <16 x i16>) to <16 x i8>) to <2 x i64>), i8 8, i8 16)
151 define <2 x i64> @test_insertq_call(<2 x i64> %x, <2 x i64> %y) {
152 ; CHECK-LABEL: @test_insertq_call(
153 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]]) #[[ATTR1]]
154 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
156 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> %x, <2 x i64> %y) nounwind
160 define <2 x i64> @test_insertq_to_insertqi(<2 x i64> %x, <2 x i64> %y) {
161 ; CHECK-LABEL: @test_insertq_to_insertqi(
162 ; CHECK-NEXT: [[TMP1:%.*]] = call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> <i64 8, i64 poison>, i8 18, i8 2)
163 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
165 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> %x, <2 x i64> <i64 8, i64 658>) nounwind
169 define <2 x i64> @test_insertq_constant(<2 x i64> %x, <2 x i64> %y) {
170 ; CHECK-LABEL: @test_insertq_constant(
171 ; CHECK-NEXT: ret <2 x i64> <i64 32, i64 undef>
173 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> <i64 0, i64 0>, <2 x i64> <i64 8, i64 658>) nounwind
177 define <2 x i64> @test_insertq_constant_undef(<2 x i64> %x, <2 x i64> %y) {
178 ; CHECK-LABEL: @test_insertq_constant_undef(
179 ; CHECK-NEXT: ret <2 x i64> <i64 33, i64 undef>
181 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> <i64 1, i64 undef>, <2 x i64> <i64 8, i64 658>) nounwind
185 define <2 x i64> @test_insertq_call_constexpr(<2 x i64> %x) {
186 ; CHECK-LABEL: @test_insertq_call_constexpr(
187 ; CHECK-NEXT: [[TMP1:%.*]] = call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> <i64 0, i64 poison>, i8 2, i8 0)
188 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
190 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> %x, <2 x i64> bitcast (<16 x i8> trunc (<16 x i16> bitcast (<4 x i64> <i64 0, i64 undef, i64 2, i64 undef> to <16 x i16>) to <16 x i8>) to <2 x i64>))
198 define <16 x i8> @test_insertqi_shuffle_04uu(<16 x i8> %v, <16 x i8> %i) {
199 ; CHECK-LABEL: @test_insertqi_shuffle_04uu(
200 ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <16 x i8> [[V:%.*]], <16 x i8> [[I:%.*]], <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 16, i32 17, i32 18, i32 19, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
201 ; CHECK-NEXT: ret <16 x i8> [[TMP1]]
203 %1 = bitcast <16 x i8> %v to <2 x i64>
204 %2 = bitcast <16 x i8> %i to <2 x i64>
205 %3 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %1, <2 x i64> %2, i8 32, i8 32)
206 %4 = bitcast <2 x i64> %3 to <16 x i8>
210 define <16 x i8> @test_insertqi_shuffle_8123uuuu(<16 x i8> %v, <16 x i8> %i) {
211 ; CHECK-LABEL: @test_insertqi_shuffle_8123uuuu(
212 ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <16 x i8> [[I:%.*]], <16 x i8> [[V:%.*]], <16 x i32> <i32 0, i32 1, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
213 ; CHECK-NEXT: ret <16 x i8> [[TMP1]]
215 %1 = bitcast <16 x i8> %v to <2 x i64>
216 %2 = bitcast <16 x i8> %i to <2 x i64>
217 %3 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %1, <2 x i64> %2, i8 16, i8 0)
218 %4 = bitcast <2 x i64> %3 to <16 x i8>
222 define <2 x i64> @test_insertqi_constant(<2 x i64> %v, <2 x i64> %i) {
223 ; CHECK-LABEL: @test_insertqi_constant(
224 ; CHECK-NEXT: ret <2 x i64> <i64 -131055, i64 undef>
226 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> <i64 -1, i64 -1>, <2 x i64> <i64 8, i64 0>, i8 16, i8 1)
230 define <2 x i64> @test_insertqi_call_constexpr(<2 x i64> %x) {
231 ; CHECK-LABEL: @test_insertqi_call_constexpr(
232 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> <i64 0, i64 poison>, i8 48, i8 3)
233 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
235 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %x, <2 x i64> bitcast (<16 x i8> trunc (<16 x i16> bitcast (<4 x i64> <i64 0, i64 undef, i64 2, i64 undef> to <16 x i16>) to <16 x i8>) to <2 x i64>), i8 48, i8 3)
239 ; The result of this insert is the second arg, since the top 64 bits of
240 ; the result are undefined, and we copy the bottom 64 bits from the
242 define <2 x i64> @testInsert64Bits(<2 x i64> %v, <2 x i64> %i) {
243 ; CHECK-LABEL: @testInsert64Bits(
244 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[I:%.*]] to <16 x i8>
245 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <16 x i8> [[TMP1]], <16 x i8> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
246 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64>
247 ; CHECK-NEXT: ret <2 x i64> [[TMP3]]
249 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %v, <2 x i64> %i, i8 64, i8 0)
253 define <2 x i64> @testZeroLength(<2 x i64> %v, <2 x i64> %i) {
254 ; CHECK-LABEL: @testZeroLength(
255 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[I:%.*]] to <16 x i8>
256 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <16 x i8> [[TMP1]], <16 x i8> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
257 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64>
258 ; CHECK-NEXT: ret <2 x i64> [[TMP3]]
260 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %v, <2 x i64> %i, i8 0, i8 0)
264 define <2 x i64> @testUndefinedInsertq_1(<2 x i64> %v, <2 x i64> %i) {
265 ; CHECK-LABEL: @testUndefinedInsertq_1(
266 ; CHECK-NEXT: ret <2 x i64> undef
268 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %v, <2 x i64> %i, i8 0, i8 16)
272 define <2 x i64> @testUndefinedInsertq_2(<2 x i64> %v, <2 x i64> %i) {
273 ; CHECK-LABEL: @testUndefinedInsertq_2(
274 ; CHECK-NEXT: ret <2 x i64> undef
276 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %v, <2 x i64> %i, i8 48, i8 32)
280 define <2 x i64> @testUndefinedInsertq_3(<2 x i64> %v, <2 x i64> %i) {
281 ; CHECK-LABEL: @testUndefinedInsertq_3(
282 ; CHECK-NEXT: ret <2 x i64> undef
284 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %v, <2 x i64> %i, i8 64, i8 16)
289 ; Vector Demanded Bits
292 define <2 x i64> @test_extrq_arg0(<2 x i64> %x, <16 x i8> %y) {
293 ; CHECK-LABEL: @test_extrq_arg0(
294 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) #[[ATTR1]]
295 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
297 %1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
298 %2 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> %1, <16 x i8> %y) nounwind
302 define <2 x i64> @test_extrq_arg1(<2 x i64> %x, <16 x i8> %y) {
303 ; CHECK-LABEL: @test_extrq_arg1(
304 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) #[[ATTR1]]
305 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
307 %1 = shufflevector <16 x i8> %y, <16 x i8> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
308 %2 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> %x, <16 x i8> %1) nounwind
312 define <2 x i64> @test_extrq_args01(<2 x i64> %x, <16 x i8> %y) {
313 ; CHECK-LABEL: @test_extrq_args01(
314 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) #[[ATTR1]]
315 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
317 %1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
318 %2 = shufflevector <16 x i8> %y, <16 x i8> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
319 %3 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> %1, <16 x i8> %2) nounwind
323 define <2 x i64> @test_extrq_ret(<2 x i64> %x, <16 x i8> %y) {
324 ; CHECK-LABEL: @test_extrq_ret(
325 ; CHECK-NEXT: ret <2 x i64> poison
327 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> %x, <16 x i8> %y) nounwind
328 %2 = shufflevector <2 x i64> %1, <2 x i64> undef, <2 x i32> <i32 1, i32 1>
332 define <2 x i64> @test_extrqi_arg0(<2 x i64> %x) {
333 ; CHECK-LABEL: @test_extrqi_arg0(
334 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> [[X:%.*]], i8 3, i8 2)
335 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
337 %1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
338 %2 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> %1, i8 3, i8 2)
342 define <2 x i64> @test_extrqi_ret(<2 x i64> %x) {
343 ; CHECK-LABEL: @test_extrqi_ret(
344 ; CHECK-NEXT: ret <2 x i64> poison
346 %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> %x, i8 3, i8 2) nounwind
347 %2 = shufflevector <2 x i64> %1, <2 x i64> undef, <2 x i32> <i32 1, i32 1>
351 define <2 x i64> @test_insertq_arg0(<2 x i64> %x, <2 x i64> %y) {
352 ; CHECK-LABEL: @test_insertq_arg0(
353 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]]) #[[ATTR1]]
354 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
356 %1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
357 %2 = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> %1, <2 x i64> %y) nounwind
361 define <2 x i64> @test_insertq_ret(<2 x i64> %x, <2 x i64> %y) {
362 ; CHECK-LABEL: @test_insertq_ret(
363 ; CHECK-NEXT: ret <2 x i64> poison
365 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> %x, <2 x i64> %y) nounwind
366 %2 = shufflevector <2 x i64> %1, <2 x i64> undef, <2 x i32> <i32 1, i32 1>
370 define <2 x i64> @test_insertqi_arg0(<2 x i64> %x, <2 x i64> %y) {
371 ; CHECK-LABEL: @test_insertqi_arg0(
372 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]], i8 3, i8 2) #[[ATTR1]]
373 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
375 %1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
376 %2 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %1, <2 x i64> %y, i8 3, i8 2) nounwind
380 define <2 x i64> @test_insertqi_arg1(<2 x i64> %x, <2 x i64> %y) {
381 ; CHECK-LABEL: @test_insertqi_arg1(
382 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]], i8 3, i8 2) #[[ATTR1]]
383 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
385 %1 = shufflevector <2 x i64> %y, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
386 %2 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %x, <2 x i64> %1, i8 3, i8 2) nounwind
390 define <2 x i64> @test_insertqi_args01(<2 x i64> %x, <2 x i64> %y) {
391 ; CHECK-LABEL: @test_insertqi_args01(
392 ; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]], i8 3, i8 2) #[[ATTR1]]
393 ; CHECK-NEXT: ret <2 x i64> [[TMP1]]
395 %1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
396 %2 = shufflevector <2 x i64> %y, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
397 %3 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %1, <2 x i64> %2, i8 3, i8 2) nounwind
401 define <2 x i64> @test_insertqi_ret(<2 x i64> %x, <2 x i64> %y) {
402 ; CHECK-LABEL: @test_insertqi_ret(
403 ; CHECK-NEXT: ret <2 x i64> poison
405 %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %x, <2 x i64> %y, i8 3, i8 2) nounwind
406 %2 = shufflevector <2 x i64> %1, <2 x i64> undef, <2 x i32> <i32 1, i32 1>
410 declare <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64>, <16 x i8>) nounwind
412 declare <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64>, i8, i8) nounwind
414 declare <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64>, <2 x i64>) nounwind
416 declare <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64>, <2 x i64>, i8, i8) nounwind