Skip to content

Commit 154d93b

Browse files
committed
[AMDGPU] Add a negative test for DPP combine into v_mul_lo_u32
1 parent bd46067 commit 154d93b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

llvm/test/CodeGen/AMDGPU/dpp_combine.ll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ define amdgpu_kernel void @dpp_fadd(ptr addrspace(1) %arg) {
4747
ret void
4848
}
4949

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

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

0 commit comments

Comments
 (0)