-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[MLIR][NFC] Fix incomplete boundary comments. #133516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I observed that we have the boundary comments in the codebase like: ``` //===----------------------------------------------------------------------===// // ... //===----------------------------------------------------------------------===// ``` I also observed that there are incomplete boundary comments. The revision is generated by a script that completes the boundary comments. Signed-off-by: hanhanW <[email protected]>
@llvm/pr-subscribers-mlir-llvm @llvm/pr-subscribers-mlir-pdl Author: Han-Chung Wang (hanhanW) ChangesI observed that we have the boundary comments in the codebase like:
I also observed that there are incomplete boundary comments. The revision is generated by a script that completes the boundary comments.
Patch is 109.02 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/133516.diff 60 Files Affected:
diff --git a/mlir/include/mlir-c/Rewrite.h b/mlir/include/mlir-c/Rewrite.h
index d8f2275b61532..61d3446317550 100644
--- a/mlir/include/mlir-c/Rewrite.h
+++ b/mlir/include/mlir-c/Rewrite.h
@@ -48,6 +48,7 @@ mlirRewriterBaseGetContext(MlirRewriterBase rewriter);
//===----------------------------------------------------------------------===//
/// Insertion points methods
+//===----------------------------------------------------------------------===//
// These do not include functions using Block::iterator or Region::iterator, as
// they are not exposed by the C API yet. Similarly for methods using
@@ -101,6 +102,7 @@ mlirRewriterBaseGetBlock(MlirRewriterBase rewriter);
//===----------------------------------------------------------------------===//
/// Block and operation creation/insertion/cloning
+//===----------------------------------------------------------------------===//
// These functions do not include the IRMapper, as it is not yet exposed by the
// C API.
diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
index 18177b9e24f7d..8945466f5ef5b 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
@@ -145,6 +145,7 @@ class ROCDL_DimGetterFunctionOp<string mnemonic, string device_function,
//===----------------------------------------------------------------------===//
// Wave-level primitives
+//===----------------------------------------------------------------------===//
class ROCDL_MbcntOp<string mnemonic> :
ROCDL_IntrPure1Op<"mbcnt." # mnemonic>,
@@ -205,6 +206,7 @@ def ROCDL_ReadlaneOp : ROCDL_IntrOp<"readlane", [], [0], [AllTypesMatch<["res",
//===----------------------------------------------------------------------===//
// Thread index and Block index
+//===----------------------------------------------------------------------===//
def ROCDL_ThreadIdXOp : ROCDL_SpecialIdRegisterOp<"workitem.id.x">;
def ROCDL_ThreadIdYOp : ROCDL_SpecialIdRegisterOp<"workitem.id.y">;
@@ -216,6 +218,7 @@ def ROCDL_BlockIdZOp : ROCDL_SpecialIdRegisterOp<"workgroup.id.z">;
//===----------------------------------------------------------------------===//
// Thread range and Block range
+//===----------------------------------------------------------------------===//
def ROCDL_BlockDimXOp : ROCDL_DimGetterFunctionOp<"workgroup.dim.x",
"__ockl_get_local_size", 0>;
@@ -237,6 +240,7 @@ def ROCDL_GridDimZOp : ROCDL_DimGetterFunctionOp<"grid.dim.z",
//===----------------------------------------------------------------------===//
// Synchronization primitives
+//===----------------------------------------------------------------------===//
// Emits the waintcnt instruction. The bitfield's semantics depend
// on the target chipset
diff --git a/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td b/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
index 901acc0e6733b..b8ad86b62e827 100644
--- a/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
+++ b/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
@@ -60,6 +60,7 @@ class PDLInterp_Op<string mnemonic, list<Trait> traits = []> :
//===----------------------------------------------------------------------===//
// PDLInterp_PredicateOp
+//===----------------------------------------------------------------------===//
// Check operations evaluate a predicate on a positional value and then
// conditionally branch on the result.
@@ -70,6 +71,7 @@ class PDLInterp_PredicateOp<string mnemonic, list<Trait> traits = []> :
//===----------------------------------------------------------------------===//
// PDLInterp_SwitchOp
+//===----------------------------------------------------------------------===//
// Switch operations evaluate a predicate on a positional value and then
// conditionally branch on the result.
diff --git a/mlir/include/mlir/IR/AsmState.h b/mlir/include/mlir/IR/AsmState.h
index edbd3bb6fc15d..5e9311742bd94 100644
--- a/mlir/include/mlir/IR/AsmState.h
+++ b/mlir/include/mlir/IR/AsmState.h
@@ -81,6 +81,7 @@ class AsmStateImpl;
//===----------------------------------------------------------------------===//
// Resource Entry
+//===----------------------------------------------------------------------===//
class HeapAsmResourceBlob;
@@ -330,6 +331,7 @@ class AsmParsedResourceEntry {
//===----------------------------------------------------------------------===//
// Resource Parser/Printer
+//===----------------------------------------------------------------------===//
/// This class represents an instance of a resource parser. This class should be
/// implemented by non-dialect clients that want to inject additional resources
diff --git a/mlir/include/mlir/IR/BuiltinAttributes.h b/mlir/include/mlir/IR/BuiltinAttributes.h
index 901df3a25a46f..67fab7ebc13ba 100644
--- a/mlir/include/mlir/IR/BuiltinAttributes.h
+++ b/mlir/include/mlir/IR/BuiltinAttributes.h
@@ -717,6 +717,7 @@ using DenseResourceElementsHandle = DialectResourceBlobHandle<BuiltinDialect>;
namespace mlir {
//===----------------------------------------------------------------------===//
// DenseArrayAttr
+//===----------------------------------------------------------------------===//
namespace detail {
/// Base class for DenseArrayAttr that is instantiated and specialized for each
@@ -772,6 +773,7 @@ using DenseF64ArrayAttr = detail::DenseArrayAttrImpl<double>;
//===----------------------------------------------------------------------===//
// DenseResourceElementsAttr
+//===----------------------------------------------------------------------===//
namespace detail {
/// Base class for DenseResourceElementsAttr that is instantiated and
diff --git a/mlir/include/mlir/IR/BuiltinTypes.td b/mlir/include/mlir/IR/BuiltinTypes.td
index af474b3e3ec47..bcd76d928cf83 100644
--- a/mlir/include/mlir/IR/BuiltinTypes.td
+++ b/mlir/include/mlir/IR/BuiltinTypes.td
@@ -98,6 +98,7 @@ class Builtin_CachedFloatType<string name, string mnemonic,
//===----------------------------------------------------------------------===//
// Float8E5M2Type
+//===----------------------------------------------------------------------===//
def Builtin_Float8E5M2 : Builtin_FloatType<"Float8E5M2", "f8E5M2"> {
let summary = "8-bit floating point with 2 bit mantissa";
@@ -119,6 +120,7 @@ def Builtin_Float8E5M2 : Builtin_FloatType<"Float8E5M2", "f8E5M2"> {
//===----------------------------------------------------------------------===//
// Float8E4M3Type
+//===----------------------------------------------------------------------===//
def Builtin_Float8E4M3 : Builtin_FloatType<"Float8E4M3", "f8E4M3"> {
let summary = "8-bit floating point with 3 bit mantissa";
@@ -138,6 +140,7 @@ def Builtin_Float8E4M3 : Builtin_FloatType<"Float8E4M3", "f8E4M3"> {
//===----------------------------------------------------------------------===//
// Float8E4M3FNType
+//===----------------------------------------------------------------------===//
def Builtin_Float8E4M3FN : Builtin_FloatType<"Float8E4M3FN", "f8E4M3FN"> {
let summary = "8-bit floating point with 3 bit mantissa";
@@ -160,6 +163,7 @@ def Builtin_Float8E4M3FN : Builtin_FloatType<"Float8E4M3FN", "f8E4M3FN"> {
//===----------------------------------------------------------------------===//
// Float8E5M2FNUZType
+//===----------------------------------------------------------------------===//
def Builtin_Float8E5M2FNUZ : Builtin_FloatType<"Float8E5M2FNUZ", "f8E5M2FNUZ"> {
let summary = "8-bit floating point with 2 bit mantissa";
@@ -182,6 +186,7 @@ def Builtin_Float8E5M2FNUZ : Builtin_FloatType<"Float8E5M2FNUZ", "f8E5M2FNUZ"> {
//===----------------------------------------------------------------------===//
// Float8E4M3FNUZType
+//===----------------------------------------------------------------------===//
def Builtin_Float8E4M3FNUZ : Builtin_FloatType<"Float8E4M3FNUZ", "f8E4M3FNUZ"> {
let summary = "8-bit floating point with 3 bit mantissa";
@@ -204,6 +209,7 @@ def Builtin_Float8E4M3FNUZ : Builtin_FloatType<"Float8E4M3FNUZ", "f8E4M3FNUZ"> {
//===----------------------------------------------------------------------===//
// Float8E4M3B11FNUZType
+//===----------------------------------------------------------------------===//
def Builtin_Float8E4M3B11FNUZ : Builtin_FloatType<"Float8E4M3B11FNUZ", "f8E4M3B11FNUZ"> {
let summary = "8-bit floating point with 3 bit mantissa";
@@ -226,6 +232,7 @@ def Builtin_Float8E4M3B11FNUZ : Builtin_FloatType<"Float8E4M3B11FNUZ", "f8E4M3B1
//===----------------------------------------------------------------------===//
// Float8E3M4Type
+//===----------------------------------------------------------------------===//
def Builtin_Float8E3M4 : Builtin_FloatType<"Float8E3M4", "f8E3M4"> {
let summary = "8-bit floating point with 3 bits exponent and 4 bit mantissa";
@@ -245,6 +252,7 @@ def Builtin_Float8E3M4 : Builtin_FloatType<"Float8E3M4", "f8E3M4"> {
//===----------------------------------------------------------------------===//
// Float4E2M1FNType
+//===----------------------------------------------------------------------===//
def Builtin_Float4E2M1FN : Builtin_FloatType<"Float4E2M1FN", "f4E2M1FN"> {
let summary = "4-bit floating point with 2-bit exponent and 1-bit mantissa";
@@ -266,6 +274,7 @@ def Builtin_Float4E2M1FN : Builtin_FloatType<"Float4E2M1FN", "f4E2M1FN"> {
//===----------------------------------------------------------------------===//
// Float6E2M3FNType
+//===----------------------------------------------------------------------===//
def Builtin_Float6E2M3FN : Builtin_FloatType<"Float6E2M3FN", "f6E2M3FN"> {
let summary = "6-bit floating point with 2-bit exponent and 3-bit mantissa";
@@ -287,6 +296,7 @@ def Builtin_Float6E2M3FN : Builtin_FloatType<"Float6E2M3FN", "f6E2M3FN"> {
//===----------------------------------------------------------------------===//
// Float6E3M2FNType
+//===----------------------------------------------------------------------===//
def Builtin_Float6E3M2FN : Builtin_FloatType<"Float6E3M2FN", "f6E3M2FN"> {
let summary = "6-bit floating point with 3-bit exponent and 2-bit mantissa";
@@ -308,6 +318,7 @@ def Builtin_Float6E3M2FN : Builtin_FloatType<"Float6E3M2FN", "f6E3M2FN"> {
//===----------------------------------------------------------------------===//
// Float8E8M0FNUType
+//===----------------------------------------------------------------------===//
def Builtin_Float8E8M0FNU : Builtin_FloatType<"Float8E8M0FNU", "f8E8M0FNU"> {
let summary = "8-bit floating point with 8-bit exponent, no mantissa or sign";
@@ -331,6 +342,7 @@ def Builtin_Float8E8M0FNU : Builtin_FloatType<"Float8E8M0FNU", "f8E8M0FNU"> {
//===----------------------------------------------------------------------===//
// BFloat16Type
+//===----------------------------------------------------------------------===//
def Builtin_BFloat16 : Builtin_CachedFloatType<"BFloat16", "bf16",
/*declaredInterfaceMethods=*/["scaleElementBitwidth"]> {
@@ -339,6 +351,7 @@ def Builtin_BFloat16 : Builtin_CachedFloatType<"BFloat16", "bf16",
//===----------------------------------------------------------------------===//
// Float16Type
+//===----------------------------------------------------------------------===//
def Builtin_Float16 : Builtin_CachedFloatType<"Float16", "f16",
/*declaredInterfaceMethods=*/["scaleElementBitwidth"]> {
@@ -347,6 +360,7 @@ def Builtin_Float16 : Builtin_CachedFloatType<"Float16", "f16",
//===----------------------------------------------------------------------===//
// FloatTF32Type
+//===----------------------------------------------------------------------===//
def Builtin_FloatTF32 : Builtin_CachedFloatType<"FloatTF32", "tf32"> {
let summary = "TF32 floating-point type";
@@ -354,6 +368,7 @@ def Builtin_FloatTF32 : Builtin_CachedFloatType<"FloatTF32", "tf32"> {
//===----------------------------------------------------------------------===//
// Float32Type
+//===----------------------------------------------------------------------===//
def Builtin_Float32 : Builtin_CachedFloatType<"Float32", "f32",
/*declaredInterfaceMethods=*/["scaleElementBitwidth"]> {
@@ -362,6 +377,7 @@ def Builtin_Float32 : Builtin_CachedFloatType<"Float32", "f32",
//===----------------------------------------------------------------------===//
// Float64Type
+//===----------------------------------------------------------------------===//
def Builtin_Float64 : Builtin_CachedFloatType<"Float64", "f64"> {
let summary = "64-bit floating-point type";
@@ -369,6 +385,7 @@ def Builtin_Float64 : Builtin_CachedFloatType<"Float64", "f64"> {
//===----------------------------------------------------------------------===//
// Float80Type
+//===----------------------------------------------------------------------===//
def Builtin_Float80 : Builtin_CachedFloatType<"Float80", "f80"> {
let summary = "80-bit floating-point type";
@@ -376,6 +393,7 @@ def Builtin_Float80 : Builtin_CachedFloatType<"Float80", "f80"> {
//===----------------------------------------------------------------------===//
// Float128Type
+//===----------------------------------------------------------------------===//
def Builtin_Float128 : Builtin_CachedFloatType<"Float128", "f128"> {
let summary = "128-bit floating-point type";
diff --git a/mlir/include/mlir/IR/CommonAttrConstraints.td b/mlir/include/mlir/IR/CommonAttrConstraints.td
index 2beb1e8110afe..e91a13fea5c7f 100644
--- a/mlir/include/mlir/IR/CommonAttrConstraints.td
+++ b/mlir/include/mlir/IR/CommonAttrConstraints.td
@@ -23,6 +23,7 @@ include "mlir/IR/DialectBase.td"
//===----------------------------------------------------------------------===//
// Base attribute definition
+//===----------------------------------------------------------------------===//
// Base class for all attributes.
class Attr<Pred condition, string summary = ""> :
@@ -91,6 +92,7 @@ class DialectAttr<Dialect d, Pred condition, string summary = ""> :
//===----------------------------------------------------------------------===//
// Attribute modifier definition
+//===----------------------------------------------------------------------===//
// Decorates an attribute to have an (unvalidated) default value if not present.
class DefaultValuedAttr<Attr attr, string val> :
@@ -150,6 +152,7 @@ class DefaultValuedOptionalStrAttr<Attr attr, string val>
//===----------------------------------------------------------------------===//
// Primitive attribute kinds
+//===----------------------------------------------------------------------===//
// A generic attribute that must be constructed around a specific buildable type
// `attrValType`. Backed by MLIR attribute kind `attrKind`.
@@ -395,6 +398,7 @@ def UnitAttr : Attr<CPred<"::llvm::isa<::mlir::UnitAttr>($_self)">, "unit attrib
//===----------------------------------------------------------------------===//
// Composite attribute kinds
+//===----------------------------------------------------------------------===//
class DictionaryAttrBase<Pred condition, string summary> :
Attr<condition, summary> {
@@ -681,6 +685,7 @@ def FlatSymbolRefArrayAttr :
//===----------------------------------------------------------------------===//
// Derive attribute kinds
+//===----------------------------------------------------------------------===//
// DerivedAttr are attributes whose value is computed from properties
// of the operation. They do not require additional storage and are
@@ -714,6 +719,7 @@ class DerivedTypeAttr<code body> : DerivedAttr<"::mlir::Type", body> {
//===----------------------------------------------------------------------===//
// Constant attribute kinds
+//===----------------------------------------------------------------------===//
// Represents a constant attribute of specific Attr type. A constant
// attribute can be specified only of attributes that have a constant
diff --git a/mlir/include/mlir/IR/CommonTypeConstraints.td b/mlir/include/mlir/IR/CommonTypeConstraints.td
index 601517717978e..e6f17ded4628b 100644
--- a/mlir/include/mlir/IR/CommonTypeConstraints.td
+++ b/mlir/include/mlir/IR/CommonTypeConstraints.td
@@ -679,6 +679,7 @@ def AnyShaped: ShapedContainerType<[AnyType], IsShapedTypePred, "shaped",
//===----------------------------------------------------------------------===//
// Tensor types.
+//===----------------------------------------------------------------------===//
// Unranked tensor type whose element type is from the given `allowedTypes`
// list, and which additionally satisfies an optional list of predicates.
@@ -755,6 +756,7 @@ def AnyStaticShapeTensor : StaticShapeTensorOf<[AnyType]>;
//===----------------------------------------------------------------------===//
// Memref type.
+//===----------------------------------------------------------------------===//
// Any unranked memref whose element type is from the given `allowedTypes` list.
class UnrankedMemRefOf<list<Type> allowedTypes> :
diff --git a/mlir/include/mlir/IR/EnumAttr.td b/mlir/include/mlir/IR/EnumAttr.td
index e5406546b1950..931126a155fbb 100644
--- a/mlir/include/mlir/IR/EnumAttr.td
+++ b/mlir/include/mlir/IR/EnumAttr.td
@@ -13,6 +13,7 @@ include "mlir/IR/AttrTypeBase.td"
//===----------------------------------------------------------------------===//
// Enum attribute kinds
+//===----------------------------------------------------------------------===//
// Additional information for an enum case.
class EnumCase<string sym, int intVal, string strVal, int widthVal> {
diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h
index 4fad61580b31a..237d48756c749 100644
--- a/mlir/include/mlir/IR/OpDefinition.h
+++ b/mlir/include/mlir/IR/OpDefinition.h
@@ -385,6 +385,7 @@ class TraitBase {
//===----------------------------------------------------------------------===//
// Operand Traits
+//===----------------------------------------------------------------------===//
namespace detail {
/// Utility trait base that provides accessors for derived traits that have
@@ -514,6 +515,7 @@ class VariadicOperands
//===----------------------------------------------------------------------===//
// Region Traits
+//===----------------------------------------------------------------------===//
/// This class provides verification for ops that are known to have zero
/// regions.
@@ -606,6 +608,7 @@ class VariadicRegions
//===----------------------------------------------------------------------===//
// Result Traits
+//===----------------------------------------------------------------------===//
/// This class provides return value APIs for ops that are known to have
/// zero results.
@@ -757,6 +760,7 @@ class VariadicResults
//===----------------------------------------------------------------------===//
// Terminator Traits
+//===----------------------------------------------------------------------===//
/// This class indicates that the regions associated with this op don't have
/// terminators.
@@ -868,6 +872,7 @@ class VariadicSuccessors
//===----------------------------------------------------------------------===//
// SingleBlock
+//===----------------------------------------------------------------------===//
/// This class provides APIs and verifiers for ops with regions having a single
/// block.
@@ -949,6 +954,7 @@ struct SingleBlock : public TraitBase<ConcreteType, SingleBlock> {
//===----------------------------------------------------------------------===//
// SingleBlockImplicitTerminator
+//===----------------------------------------------------------------------===//
/// This class provides APIs and verifiers for ops with regions having a single
/// block that must terminate with `TerminatorOpType`.
@@ -1034,6 +1040,7 @@ struct hasSingleBlockImplicitTerminator<Op, false> {
//===----------------------------------------------------------------------===//
// Misc Traits
+//===----------------------------------------------------------------------===//
/// This class provides verification for ops that are known to have the same
/// operand shape: all operands are scalars, vectors/tensors of the same
@@ -1514,6 +1521,7 @@ bool hasEleme...
[truncated]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite a few of them are missing, wow! Thanks for the fix, that's much appreciated 🙏🏻
LGTM
I observed that we have the boundary comments in the codebase like:
I also observed that there are incomplete boundary comments. The revision is generated by a script that completes the boundary comments.