[llvm] 154d93b - [AMDGPU] Add a negative test for DPP combine into v_mul_lo_u32

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 08:08:50 PDT 2024


Author: Jay Foad
Date: 2024-05-22T16:08:44+01:00
New Revision: 154d93b7f258cdf1157b5e5d61dd9477ffd3db53

URL: https://github.com/llvm/llvm-project/commit/154d93b7f258cdf1157b5e5d61dd9477ffd3db53
DIFF: https://github.com/llvm/llvm-project/commit/154d93b7f258cdf1157b5e5d61dd9477ffd3db53.diff

LOG: [AMDGPU] Add a negative test for DPP combine into v_mul_lo_u32

Added: 
    

Modified: 
    llvm/test/CodeGen/AMDGPU/dpp_combine.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/AMDGPU/dpp_combine.ll b/llvm/test/CodeGen/AMDGPU/dpp_combine.ll
index cfc166ec798f4..5162092f78aca 100644
--- a/llvm/test/CodeGen/AMDGPU/dpp_combine.ll
+++ b/llvm/test/CodeGen/AMDGPU/dpp_combine.ll
@@ -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


        


More information about the llvm-commits mailing list