1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL
3
4--- |
5  define void @test_insert_128() {
6    ret void
7  }
8
9  define void @test_insert_256() {
10    ret void
11  }
12...
13---
14name:            test_insert_128
15alignment:       4
16legalized:       false
17regBankSelected: false
18registers:
19  - { id: 0, class: _ }
20  - { id: 1, class: _ }
21  - { id: 2, class: _ }
22body:             |
23  bb.1 (%ir-block.0):
24    liveins: $zmm0, $ymm1
25
26    ; ALL-LABEL: name: test_insert_128
27    ; ALL: [[COPY:%[0-9]+]]:_(<16 x s32>) = COPY $zmm0
28    ; ALL: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $xmm1
29    ; ALL: [[INSERT:%[0-9]+]]:_(<16 x s32>) = G_INSERT [[COPY]], [[COPY1]](<4 x s32>), 0
30    ; ALL: $zmm0 = COPY [[INSERT]](<16 x s32>)
31    ; ALL: RET 0, implicit $ymm0
32    %0(<16 x s32>) = COPY $zmm0
33    %1(<4 x s32>) = COPY $xmm1
34    %2(<16 x s32>) = G_INSERT %0(<16 x s32>), %1(<4 x s32>), 0
35    $zmm0 = COPY %2(<16 x s32>)
36    RET 0, implicit $ymm0
37
38...
39---
40name:            test_insert_256
41alignment:       4
42legalized:       false
43regBankSelected: false
44registers:
45  - { id: 0, class: _ }
46  - { id: 1, class: _ }
47  - { id: 2, class: _ }
48body:             |
49  bb.1 (%ir-block.0):
50    liveins: $zmm0, $ymm1
51
52    ; ALL-LABEL: name: test_insert_256
53    ; ALL: [[COPY:%[0-9]+]]:_(<16 x s32>) = COPY $zmm0
54    ; ALL: [[COPY1:%[0-9]+]]:_(<8 x s32>) = COPY $ymm1
55    ; ALL: [[INSERT:%[0-9]+]]:_(<16 x s32>) = G_INSERT [[COPY]], [[COPY1]](<8 x s32>), 0
56    ; ALL: $zmm0 = COPY [[INSERT]](<16 x s32>)
57    ; ALL: RET 0, implicit $ymm0
58    %0(<16 x s32>) = COPY $zmm0
59    %1(<8 x s32>) = COPY $ymm1
60    %2(<16 x s32>) = G_INSERT %0(<16 x s32>), %1(<8 x s32>), 0
61    $zmm0 = COPY %2(<16 x s32>)
62    RET 0, implicit $ymm0
63
64...
65