1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer %s -o - | FileCheck %s
5 name: insert_vector_elt_0_v2s32
9 liveins: $vgpr0_vgpr1, $vgpr2
10 ; CHECK-LABEL: name: insert_vector_elt_0_v2s32
11 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
12 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
13 ; CHECK: [[INSERT:%[0-9]+]]:_(<2 x s32>) = G_INSERT [[COPY]], [[COPY1]](s32), 0
14 ; CHECK: $vgpr0_vgpr1 = COPY [[INSERT]](<2 x s32>)
15 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
16 %1:_(s32) = COPY $vgpr2
17 %2:_(s32) = G_CONSTANT i32 0
18 %3:_(<2 x s32>) = G_INSERT_VECTOR_ELT %0, %1, %2
19 $vgpr0_vgpr1 = COPY %3
23 name: insert_vector_elt_1_v2s32
27 liveins: $vgpr0_vgpr1, $vgpr2
28 ; CHECK-LABEL: name: insert_vector_elt_1_v2s32
29 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
30 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
31 ; CHECK: [[INSERT:%[0-9]+]]:_(<2 x s32>) = G_INSERT [[COPY]], [[COPY1]](s32), 32
32 ; CHECK: $vgpr0_vgpr1 = COPY [[INSERT]](<2 x s32>)
33 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
34 %1:_(s32) = COPY $vgpr2
35 %2:_(s32) = G_CONSTANT i32 1
36 %3:_(<2 x s32>) = G_INSERT_VECTOR_ELT %0, %1, %2
37 $vgpr0_vgpr1 = COPY %3
41 name: insert_vector_elt_2_v2s32
45 liveins: $vgpr0_vgpr1, $vgpr2
46 ; CHECK-LABEL: name: insert_vector_elt_2_v2s32
47 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
48 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
49 ; CHECK: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
50 ; CHECK: $vgpr0_vgpr1 = COPY [[DEF]](<2 x s32>)
51 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
52 %1:_(s32) = COPY $vgpr2
53 %2:_(s32) = G_CONSTANT i32 2
54 %3:_(<2 x s32>) = G_INSERT_VECTOR_ELT %0, %1, %2
55 $vgpr0_vgpr1 = COPY %3
59 name: insert_vector_elt_v2s32_varidx_i64
63 liveins: $vgpr0_vgpr1, $vgpr2, $vgpr3_vgpr4
65 ; CHECK-LABEL: name: insert_vector_elt_v2s32_varidx_i64
66 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
67 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
68 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $vgpr3_vgpr4
69 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY2]](s64)
70 ; CHECK: [[IVEC:%[0-9]+]]:_(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], [[COPY1]](s32), [[TRUNC]](s32)
71 ; CHECK: $vgpr0_vgpr1 = COPY [[IVEC]](<2 x s32>)
72 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
73 %1:_(s32) = COPY $vgpr2
74 %2:_(s64) = COPY $vgpr3_vgpr4
75 %3:_(<2 x s32>) = G_INSERT_VECTOR_ELT %0, %1, %2
76 $vgpr0_vgpr1 = COPY %3
80 name: insert_vector_elt_v16s32_varidx_i64
84 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15, $vgpr16, $vgpr17_vgpr18
86 ; CHECK-LABEL: name: insert_vector_elt_v16s32_varidx_i64
87 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
88 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr16
89 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $vgpr17_vgpr18
90 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY2]](s64)
91 ; CHECK: [[IVEC:%[0-9]+]]:_(<16 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], [[COPY1]](s32), [[TRUNC]](s32)
92 ; CHECK: S_ENDPGM 0, implicit [[IVEC]](<16 x s32>)
93 %0:_(<16 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
94 %1:_(s32) = COPY $vgpr16
95 %2:_(s64) = COPY $vgpr17_vgpr18
96 %3:_(<16 x s32>) = G_INSERT_VECTOR_ELT %0, %1, %2
97 S_ENDPGM 0, implicit %3