1; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck %s 2 3; CHECK: 'insertelement_v2i32' 4; CHECK: estimated cost of 0 for {{.*}} insertelement <2 x i32> 5define void @insertelement_v2i32(<2 x i32> addrspace(1)* %out, <2 x i32> addrspace(1)* %vaddr) { 6 %vec = load <2 x i32>, <2 x i32> addrspace(1)* %vaddr 7 %insert = insertelement <2 x i32> %vec, i32 1, i32 123 8 store <2 x i32> %insert, <2 x i32> addrspace(1)* %out 9 ret void 10} 11 12; CHECK: 'insertelement_v2i64' 13; CHECK: estimated cost of 0 for {{.*}} insertelement <2 x i64> 14define void @insertelement_v2i64(<2 x i64> addrspace(1)* %out, <2 x i64> addrspace(1)* %vaddr) { 15 %vec = load <2 x i64>, <2 x i64> addrspace(1)* %vaddr 16 %insert = insertelement <2 x i64> %vec, i64 1, i64 123 17 store <2 x i64> %insert, <2 x i64> addrspace(1)* %out 18 ret void 19} 20 21; CHECK: 'insertelement_v2i16' 22; CHECK: estimated cost of 0 for {{.*}} insertelement <2 x i16> 23define void @insertelement_v2i16(<2 x i16> addrspace(1)* %out, <2 x i16> addrspace(1)* %vaddr) { 24 %vec = load <2 x i16>, <2 x i16> addrspace(1)* %vaddr 25 %insert = insertelement <2 x i16> %vec, i16 1, i16 123 26 store <2 x i16> %insert, <2 x i16> addrspace(1)* %out 27 ret void 28} 29 30; CHECK: 'insertelement_v2i8' 31; CHECK: estimated cost of 0 for {{.*}} insertelement <2 x i8> 32define void @insertelement_v2i8(<2 x i8> addrspace(1)* %out, <2 x i8> addrspace(1)* %vaddr) { 33 %vec = load <2 x i8>, <2 x i8> addrspace(1)* %vaddr 34 %insert = insertelement <2 x i8> %vec, i8 1, i8 123 35 store <2 x i8> %insert, <2 x i8> addrspace(1)* %out 36 ret void 37} 38