1# RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -global-isel-abort=2 -pass-remarks-missed='gisel*' -verify-machineinstrs -o /dev/null %s 2>&1 | FileCheck -check-prefix=ERR %s
2
3# ERR: remark: <unknown>:0:0: cannot select: %3:sgpr(<4 x s16>) = G_INSERT %0:sgpr, %2:sgpr(s16), 0 (in function: insert_sgpr_s16_to_v4s16_offset0)
4# ERR-NEXT: remark: <unknown>:0:0: cannot select: %2:sgpr(<16 x s32>) = G_INSERT %0:sgpr, %1:sgpr(<8 x s32>), 0 (in function: insert_sgpr_v8s32_to_v16s32_offset0)
5# ERR-NOT: remark
6
7# FIXME: This 16-bit insert source should not be legal and this test
8# should be deleted
9---
10name:            insert_sgpr_s16_to_v4s16_offset0
11legalized:       true
12regBankSelected: true
13
14body: |
15  bb.0:
16    liveins: $sgpr0_sgpr1, $sgpr2
17    %0:sgpr(<4 x s16>) = COPY $sgpr0_sgpr1
18    %1:sgpr(s32) = COPY $sgpr2
19    %2:sgpr(s16) = G_TRUNC %1
20    %3:sgpr(<4 x s16>) = G_INSERT %0, %2, 0
21    S_ENDPGM 0, implicit %3
22
23...
24
25# getSubRegFromChannel current does not handle cases > 128-bits
26---
27name:            insert_sgpr_v8s32_to_v16s32_offset0
28legalized:       true
29regBankSelected: true
30
31body: |
32  bb.0:
33    liveins: $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15, $sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23
34    %0:sgpr(<16 x s32>) = COPY $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15
35    %1:sgpr(<8 x s32>) = COPY $sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23
36    %2:sgpr(<16 x s32>) = G_INSERT %0, %1, 0
37    S_ENDPGM 0, implicit %2
38
39...
40