diff --git a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td index 69745addfd748..61a62e9cc9111 100644 --- a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td +++ b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td @@ -436,8 +436,18 @@ def AMDGPU_DPPOp : AMDGPU_Op<"dpp", [SameTypeOperands, AllTypesMatch<["result", DefaultValuedAttr:$bound_ctrl)> { let summary = "AMDGPU DPP operation"; let description = [{ - This operation represents DPP functionality in a GPU program. - DPP provides the following operations: + This operation represents DPP (Data-Parallel Primitives) functionality in a GPU program. + + It will result in the values from `src`, permuted according to + the DPP attributes(`kind`, `permArgument`, `row_mask`, `bank_mask` and `bound_ctrl`). + + If a lane is masked off(by EXEC mask, `row_mask`, `bank_mask`, etc) or + has no value to receive(for example, if the source of a lane is out of range), + this operation will instead produce the value of `old`. + + For detail explanation of the attributes, please check the ISA Reference Guide. + + DPP provides the following operations: - Full crossbar in a group of four (`quad_perm`) - Wavefront shift left by one lane (`wave_shl`) - Wavefront shift right by one lane (`wave_shr`) diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td index 3695708439d91..e64f2b271aada 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td @@ -621,6 +621,21 @@ 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 = "Exchange data among lanes in a warp"; + let description = [{ + This operation maps to the DPP (Data-Parallel Primitives) intrinsics, + which allows lanes in the same warp to exchange data in their registers + directly following some very specific patterns. + + It will result in the values from `src`, permuted according to + the DPP attributes(`dppCtrl`, `rowMask`, `bankMask` and `boundCtrl`). + + If a lane is masked off(by EXEC mask, `rowMask`, `bankMask`, etc) or + has no value to receive(for example, if the source of a lane is out of range), + this operation will instead produce the value of `old`. + + For detail explanation of the attributes, please check the ISA Reference Guide. + }]; let assemblyFormat = [{ attr-dict $old `,` $src `with` $dppCtrl `,` $rowMask `,` $bankMask `,` $boundCtrl `:` type($src) }];