[Mlir-commits] [mlir] [mlir] Add description to amdgpu.dpp and rocdl.update.dpp (PR #116598)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Nov 18 09:38:37 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Kyle Wang (knwng)

<details>
<summary>Changes</summary>

Add description to amdgpu.dpp and rocdl.update.dpp to explain their behaviors.

---
Full diff: https://github.com/llvm/llvm-project/pull/116598.diff


2 Files Affected:

- (modified) mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td (+5) 
- (modified) mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td (+9) 


``````````diff
diff --git a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
index 69745addfd748e..cb25655cc29eb8 100644
--- a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
+++ b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
@@ -437,6 +437,11 @@ def AMDGPU_DPPOp : AMDGPU_Op<"dpp", [SameTypeOperands, AllTypesMatch<["result",
   let summary = "AMDGPU DPP operation";
   let description = [{
     This operation represents DPP functionality in a GPU program.
+
+    The behavior should be equivalent to:
+    v_mov_b32 `result` `old`
+    v_mov_b32 `result` `src` `kind` `row_mask` `bank_mask` `bound_ctrl`
+
      DPP provides the following operations:
     - Full crossbar in a group of four (`quad_perm`)
     - Wavefront shift left by one lane (`wave_shl`)
diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
index 3695708439d91f..a2a86a3a8a2cf0 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
@@ -621,6 +621,15 @@ def ROCDL_DPPUpdateOp : ROCDL_IntrOp<"update.dpp", [], [0],
   Arguments<(ins LLVM_Type:$old, LLVM_Type:$src, I32Attr:$dppCtrl, I32Attr:$rowMask,
       I32Attr:$bankMask, I1Attr:$boundCtrl)> {
   let results = (outs LLVM_Type:$res);
+  let summary = "Represent the DPP(Data-Parallel Primitives) functionality";
+  let description = [{
+    Represent the DPP(Data-Parallel Primitives) functionality,
+    which supports cross-lane data operations.
+
+    The behavior should be equivalent to:
+    v_mov_b32 `res` `old`
+    v_mov_b32 `res` `src` `dppCtrl` `rowMask` `bankMask` `boundCtrl`
+  }];
   let assemblyFormat = [{
     attr-dict $old `,` $src `with` $dppCtrl `,` $rowMask `,` $bankMask `,` $boundCtrl `:` type($src)
   }];

``````````

</details>


https://github.com/llvm/llvm-project/pull/116598


More information about the Mlir-commits mailing list