3 ; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s
5 ; write_register doesn't prevent us from illegally trying to write a
6 ; vgpr value into a scalar register, but I don't think there's much we
7 ; can do to avoid this.
9 declare void @llvm.write_register.i32(metadata, i32) #0
10 declare i32 @llvm.amdgcn.workitem.id.x() #0
11 declare void @llvm.amdgcn.wave.barrier() #2
13 define amdgpu_kernel void @write_vgpr_into_sgpr() {
14 %tid = call i32 @llvm.amdgcn.workitem.id.x()
15 call void @llvm.write_register.i32(metadata !0, i32 %tid)
16 call void @llvm.amdgcn.wave.barrier() #2
20 attributes #0 = { nounwind readnone }
21 attributes #1 = { nounwind }
22 attributes #2 = { convergent nounwind }