1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -run-pass=legalizer %s -o - | FileCheck %s
4 # Make sure we CSE when building a vector splat.
6 name: build_vector_v8s16_splat
9 liveins: $vgpr0, $vgpr1
10 ; CHECK-LABEL: name: build_vector_v8s16_splat
11 ; CHECK: liveins: $vgpr0, $vgpr1
13 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 16256
14 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR [[C]](s16), [[C]](s16)
15 ; CHECK-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[BUILD_VECTOR]](<2 x s16>), [[BUILD_VECTOR]](<2 x s16>), [[BUILD_VECTOR]](<2 x s16>), [[BUILD_VECTOR]](<2 x s16>)
16 ; CHECK-NEXT: S_NOP 0, implicit [[CONCAT_VECTORS]](<8 x s16>)
17 %1:_(s32) = COPY $vgpr0
18 %2:_(s32) = COPY $vgpr1
19 %0:_(p1) = G_MERGE_VALUES %1(s32), %2(s32)
20 %4:_(s16) = G_CONSTANT i16 16256
21 %3:_(<8 x s16>) = G_BUILD_VECTOR %4(s16), %4(s16), %4(s16), %4(s16), %4(s16), %4(s16), %4(s16), %4(s16)