Skip to content

Commit

Permalink
[AMDGPU] Add a negative test for DPP combine into v_mul_lo_u32
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfoad committed May 22, 2024
1 parent bd46067 commit 154d93b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions llvm/test/CodeGen/AMDGPU/dpp_combine.ll
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ define amdgpu_kernel void @dpp_fadd(ptr addrspace(1) %arg) {
ret void
}

; Fails to combine because v_mul_lo_u32 has no e32 or dpp form.
; GCN-LABEL: {{^}}dpp_mul:
; GCN: global_load_{{dword|b32}} [[V:v[0-9]+]],
; GCN: v_mov_b32_e32 [[V2:v[0-9]+]], [[V]]
; GCN: v_mov_b32_dpp [[V2]], [[V2]] quad_perm:[1,0,0,0] row_mask:0xf bank_mask:0xf bound_ctrl:1{{$}}
; GCN: v_mul_lo_u32 [[V]], [[V2]], [[V]]{{$}}
define amdgpu_kernel void @dpp_mul(ptr addrspace(1) %arg) {
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %id
%load = load i32, ptr addrspace(1) %gep
%tmp0 = call i32 @llvm.amdgcn.update.dpp.i32(i32 %load, i32 %load, i32 1, i32 15, i32 15, i1 1)
%mul = mul i32 %tmp0, %load
store i32 %mul, ptr addrspace(1) %gep
ret void
}

declare i32 @llvm.amdgcn.workitem.id.x()
declare i32 @llvm.amdgcn.update.dpp.i32(i32, i32, i32, i32, i32, i1) #0
Expand Down

0 comments on commit 154d93b

Please sign in to comment.