1; RUN: llc -march=amdgcn -mcpu=kaveri -mtriple=amdgcn-unknown-amdhsa -mattr=-flat-for-global < %s | FileCheck -check-prefix=GCN %s 2 3; Check that when mubuf addr64 instruction is handled in moveToVALU 4; from the pointer, dead register writes are not emitted. 5 6; FIXME: We should be able to use the SGPR directly as src0 to v_add_i32 7 8; GCN-LABEL: {{^}}clobber_vgpr_pair_pointer_add: 9; GCN: s_load_dwordx2 s{{\[}}[[ARG1LO:[0-9]+]]:[[ARG1HI:[0-9]+]]{{\]}}, s{{\[[0-9]+:[0-9]+\]}}, 0x0{{$}} 10 11; GCN-NOT: v_mov_b32 12; GCN: v_mov_b32_e32 v[[VARG1LO:[0-9]+]], s[[ARG1LO]] 13; GCN: buffer_load_dwordx2 v{{\[}}[[LDPTRLO:[0-9]+]]:[[LDPTRHI:[0-9]+]]{{\]}} 14; GCN-NOT: v_mov_b32 15; GCN: v_mov_b32_e32 v[[VARG1HI:[0-9]+]], s[[ARG1HI]] 16; GCN-NOT: v_mov_b32 17 18; GCN: v_add_i32_e32 v[[PTRLO:[0-9]+]], vcc, v[[LDPTRLO]], v[[VARG1LO]] 19; GCN: v_addc_u32_e32 v[[PTRHI:[0-9]+]], vcc, v[[LDPTRHI]], v[[VARG1HI]] 20; GCN: buffer_load_ubyte v{{[0-9]+}}, v{{\[}}[[PTRLO]]:[[PTRHI]]{{\]}}, 21 22define amdgpu_kernel void @clobber_vgpr_pair_pointer_add(i64 %arg1, [8 x i32], i8 addrspace(1)* addrspace(1)* %ptrarg, i32 %arg3) #0 { 23bb: 24 %tmp = icmp sgt i32 %arg3, 0 25 br i1 %tmp, label %bb4, label %bb17 26 27bb4: 28 %tmp14 = load volatile i8 addrspace(1)*, i8 addrspace(1)* addrspace(1)* %ptrarg 29 %tmp15 = getelementptr inbounds i8, i8 addrspace(1)* %tmp14, i64 %arg1 30 %tmp16 = load volatile i8, i8 addrspace(1)* %tmp15 31 br label %bb17 32 33bb17: 34 ret void 35} 36 37attributes #0 = { nounwind } 38