1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer -global-isel-abort=0 %s -o - | FileCheck %s 3 4--- 5name: concat_vectors_v2s32_v2s32 6 7body: | 8 bb.0: 9 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3 10 ; CHECK-LABEL: name: concat_vectors_v2s32_v2s32 11 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1 12 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3 13 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[COPY]](<2 x s32>), [[COPY1]](<2 x s32>) 14 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[CONCAT_VECTORS]](<4 x s32>) 15 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1 16 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3 17 %2:_(<4 x s32>) = G_CONCAT_VECTORS %0, %1 18 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %2 19... 20 21--- 22name: concat_vectors_v2s16_v2s16 23 24body: | 25 bb.0: 26 liveins: $vgpr0, $vgpr1 27 ; CHECK-LABEL: name: concat_vectors_v2s16_v2s16 28 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0 29 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1 30 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[COPY]](<2 x s16>), [[COPY1]](<2 x s16>) 31 ; CHECK: $vgpr0_vgpr1 = COPY [[CONCAT_VECTORS]](<4 x s16>) 32 %0:_(<2 x s16>) = COPY $vgpr0 33 %1:_(<2 x s16>) = COPY $vgpr1 34 %2:_(<4 x s16>) = G_CONCAT_VECTORS %0, %1 35 $vgpr0_vgpr1 = COPY %2 36... 37 38--- 39name: concat_vectors_v2s16_v2s16_v2s16_v2s16 40 41body: | 42 bb.0: 43 liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3 44 ; CHECK-LABEL: name: concat_vectors_v2s16_v2s16_v2s16_v2s16 45 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0 46 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1 47 ; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr2 48 ; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr3 49 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[COPY]](<2 x s16>), [[COPY1]](<2 x s16>), [[COPY2]](<2 x s16>), [[COPY3]](<2 x s16>) 50 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[CONCAT_VECTORS]](<8 x s16>) 51 %0:_(<2 x s16>) = COPY $vgpr0 52 %1:_(<2 x s16>) = COPY $vgpr1 53 %2:_(<2 x s16>) = COPY $vgpr2 54 %3:_(<2 x s16>) = COPY $vgpr3 55 %4:_(<8 x s16>) = G_CONCAT_VECTORS %0, %1, %2, %3 56 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %4 57... 58 59--- 60name: concat_vectors_v4s16_v4s16 61 62body: | 63 bb.0: 64 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3 65 ; CHECK-LABEL: name: concat_vectors_v4s16_v4s16 66 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1 67 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr2_vgpr3 68 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[COPY]](<4 x s16>), [[COPY1]](<4 x s16>) 69 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[CONCAT_VECTORS]](<8 x s16>) 70 %0:_(<4 x s16>) = COPY $vgpr0_vgpr1 71 %1:_(<4 x s16>) = COPY $vgpr2_vgpr3 72 %2:_(<8 x s16>) = G_CONCAT_VECTORS %0, %1 73 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %2 74... 75 76--- 77name: concat_vectors_v4s32_v4s32 78 79body: | 80 bb.0: 81 liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7 82 ; CHECK-LABEL: name: concat_vectors_v4s32_v4s32 83 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 84 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 85 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s32>) = G_CONCAT_VECTORS [[COPY]](<4 x s32>), [[COPY1]](<4 x s32>) 86 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[CONCAT_VECTORS]](<8 x s32>) 87 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3, 88 %1:_(<4 x s32>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 89 %2:_(<8 x s32>) = G_CONCAT_VECTORS %0, %1 90 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %2 91... 92 93--- 94name: concat_vectors_v2s32_v2s32_v2s32_v2s32 95 96body: | 97 bb.0: 98 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5, $vgpr6_vgpr7 99 ; CHECK-LABEL: name: concat_vectors_v2s32_v2s32_v2s32_v2s32 100 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1 101 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3 102 ; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr4_vgpr5 103 ; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr6_vgpr7 104 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s32>) = G_CONCAT_VECTORS [[COPY]](<2 x s32>), [[COPY1]](<2 x s32>), [[COPY2]](<2 x s32>), [[COPY3]](<2 x s32>) 105 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[CONCAT_VECTORS]](<8 x s32>) 106 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1 107 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3 108 %2:_(<2 x s32>) = COPY $vgpr4_vgpr5 109 %3:_(<2 x s32>) = COPY $vgpr6_vgpr7 110 111 %4:_(<8 x s32>) = G_CONCAT_VECTORS %0, %1, %2, %3 112 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %4 113... 114--- 115name: concat_vectors_v2s64_v2s64 116 117body: | 118 bb.0: 119 liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7 120 ; CHECK-LABEL: name: concat_vectors_v2s64_v2s64 121 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 122 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 123 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s64>) = G_CONCAT_VECTORS [[COPY]](<2 x s64>), [[COPY1]](<2 x s64>) 124 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[CONCAT_VECTORS]](<4 x s64>) 125 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 126 %1:_(<2 x s64>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 127 %2:_(<4 x s64>) = G_CONCAT_VECTORS %0, %1 128 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %2 129... 130 131--- 132name: concat_vectors_v2p1_v2p1 133 134body: | 135 bb.0: 136 liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7 137 ; CHECK-LABEL: name: concat_vectors_v2p1_v2p1 138 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x p1>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 139 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x p1>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 140 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x p1>) = G_CONCAT_VECTORS [[COPY]](<2 x p1>), [[COPY1]](<2 x p1>) 141 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[CONCAT_VECTORS]](<4 x p1>) 142 %0:_(<2 x p1>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 143 %1:_(<2 x p1>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 144 %2:_(<4 x p1>) = G_CONCAT_VECTORS %0, %1 145 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %2 146... 147 148--- 149name: concat_vectors_v2p0_v2p0 150 151body: | 152 bb.0: 153 liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7 154 ; CHECK-LABEL: name: concat_vectors_v2p0_v2p0 155 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 156 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 157 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x p0>) = G_CONCAT_VECTORS [[COPY]](<2 x p0>), [[COPY1]](<2 x p0>) 158 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[CONCAT_VECTORS]](<4 x p0>) 159 %0:_(<2 x p0>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 160 %1:_(<2 x p0>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 161 %2:_(<4 x p0>) = G_CONCAT_VECTORS %0, %1 162 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %2 163... 164 165--- 166name: concat_vectors_v2p3_v2p3 167 168body: | 169 bb.0: 170 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3 171 ; CHECK-LABEL: name: concat_vectors_v2p3_v2p3 172 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1 173 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr2_vgpr3 174 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x p3>) = G_CONCAT_VECTORS [[COPY]](<2 x p3>), [[COPY1]](<2 x p3>) 175 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[CONCAT_VECTORS]](<4 x p3>) 176 %0:_(<2 x p3>) = COPY $vgpr0_vgpr1 177 %1:_(<2 x p3>) = COPY $vgpr2_vgpr3 178 %2:_(<4 x p3>) = G_CONCAT_VECTORS %0, %1 179 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %2 180... 181 182--- 183name: concat_vectors_v2p5_v2p5 184 185body: | 186 bb.0: 187 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3 188 ; CHECK-LABEL: name: concat_vectors_v2p5_v2p5 189 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x p5>) = COPY $vgpr0_vgpr1 190 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x p5>) = COPY $vgpr2_vgpr3 191 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x p5>) = G_CONCAT_VECTORS [[COPY]](<2 x p5>), [[COPY1]](<2 x p5>) 192 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[CONCAT_VECTORS]](<4 x p5>) 193 %0:_(<2 x p5>) = COPY $vgpr0_vgpr1 194 %1:_(<2 x p5>) = COPY $vgpr2_vgpr3 195 %2:_(<4 x p5>) = G_CONCAT_VECTORS %0, %1 196 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %2 197... 198 199--- 200name: concat_vectors_v2p999_v2p999 201 202body: | 203 bb.0: 204 liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7 205 ; CHECK-LABEL: name: concat_vectors_v2p999_v2p999 206 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x p999>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 207 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x p999>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 208 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x p999>) = G_CONCAT_VECTORS [[COPY]](<2 x p999>), [[COPY1]](<2 x p999>) 209 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[CONCAT_VECTORS]](<4 x p999>) 210 %0:_(<2 x p999>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 211 %1:_(<2 x p999>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 212 %2:_(<4 x p999>) = G_CONCAT_VECTORS %0, %1 213 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %2 214... 215 216--- 217name: concat_vectors_v6s16_v3s16 218 219body: | 220 bb.0: 221 liveins: $vgpr0_vgpr1_vgpr2 222 ; CHECK-LABEL: name: concat_vectors_v6s16_v3s16 223 ; CHECK: [[COPY:%[0-9]+]]:_(<6 x s16>) = COPY $vgpr0_vgpr1_vgpr2 224 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>), [[UV2:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<6 x s16>) 225 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>) 226 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 227 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32) 228 ; CHECK: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>) 229 ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32) 230 ; CHECK: [[UV3:%[0-9]+]]:_(<2 x s16>), [[UV4:%[0-9]+]]:_(<2 x s16>), [[UV5:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<6 x s16>) 231 ; CHECK: [[BITCAST2:%[0-9]+]]:_(s32) = G_BITCAST [[UV4]](<2 x s16>) 232 ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST2]], [[C]](s32) 233 ; CHECK: [[BITCAST3:%[0-9]+]]:_(s32) = G_BITCAST [[UV5]](<2 x s16>) 234 ; CHECK: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST3]], [[C]](s32) 235 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 236 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32) 237 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]] 238 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 239 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]] 240 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32) 241 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]] 242 ; CHECK: [[BITCAST4:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32) 243 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32) 244 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C1]] 245 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32) 246 ; CHECK: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C1]] 247 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C]](s32) 248 ; CHECK: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]] 249 ; CHECK: [[BITCAST5:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32) 250 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[BITCAST3]](s32) 251 ; CHECK: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C1]] 252 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[LSHR3]](s32) 253 ; CHECK: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C1]] 254 ; CHECK: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND5]], [[C]](s32) 255 ; CHECK: [[OR2:%[0-9]+]]:_(s32) = G_OR [[AND4]], [[SHL2]] 256 ; CHECK: [[BITCAST6:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR2]](s32) 257 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<6 x s16>) = G_CONCAT_VECTORS [[BITCAST4]](<2 x s16>), [[BITCAST5]](<2 x s16>), [[BITCAST6]](<2 x s16>) 258 ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[CONCAT_VECTORS]](<6 x s16>) 259 %0:_(<6 x s16>) = COPY $vgpr0_vgpr1_vgpr2 260 %1:_(<3 x s16>), %2:_(<3 x s16>) = G_UNMERGE_VALUES %0 261 %3:_(<6 x s16>) = G_CONCAT_VECTORS %1, %2 262 $vgpr0_vgpr1_vgpr2 = COPY %3 263... 264