Skip to content

[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

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mlir/include/mlir-c/Rewrite.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class ROCDL_DimGetterFunctionOp<string mnemonic, string device_function,

//===----------------------------------------------------------------------===//
// Wave-level primitives
//===----------------------------------------------------------------------===//

class ROCDL_MbcntOp<string mnemonic> :
ROCDL_IntrPure1Op<"mbcnt." # mnemonic>,
Expand Down Expand Up @@ -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">;
Expand All @@ -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>;
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions mlir/include/mlir/IR/AsmState.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class AsmStateImpl;

//===----------------------------------------------------------------------===//
// Resource Entry
//===----------------------------------------------------------------------===//

class HeapAsmResourceBlob;

Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions mlir/include/mlir/IR/BuiltinAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ using DenseResourceElementsHandle = DialectResourceBlobHandle<BuiltinDialect>;
namespace mlir {
//===----------------------------------------------------------------------===//
// DenseArrayAttr
//===----------------------------------------------------------------------===//

namespace detail {
/// Base class for DenseArrayAttr that is instantiated and specialized for each
Expand Down Expand Up @@ -772,6 +773,7 @@ using DenseF64ArrayAttr = detail::DenseArrayAttrImpl<double>;

//===----------------------------------------------------------------------===//
// DenseResourceElementsAttr
//===----------------------------------------------------------------------===//

namespace detail {
/// Base class for DenseResourceElementsAttr that is instantiated and
Expand Down
18 changes: 18 additions & 0 deletions mlir/include/mlir/IR/BuiltinTypes.td
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -331,6 +342,7 @@ def Builtin_Float8E8M0FNU : Builtin_FloatType<"Float8E8M0FNU", "f8E8M0FNU"> {

//===----------------------------------------------------------------------===//
// BFloat16Type
//===----------------------------------------------------------------------===//

def Builtin_BFloat16 : Builtin_CachedFloatType<"BFloat16", "bf16",
/*declaredInterfaceMethods=*/["scaleElementBitwidth"]> {
Expand All @@ -339,6 +351,7 @@ def Builtin_BFloat16 : Builtin_CachedFloatType<"BFloat16", "bf16",

//===----------------------------------------------------------------------===//
// Float16Type
//===----------------------------------------------------------------------===//

def Builtin_Float16 : Builtin_CachedFloatType<"Float16", "f16",
/*declaredInterfaceMethods=*/["scaleElementBitwidth"]> {
Expand All @@ -347,13 +360,15 @@ def Builtin_Float16 : Builtin_CachedFloatType<"Float16", "f16",

//===----------------------------------------------------------------------===//
// FloatTF32Type
//===----------------------------------------------------------------------===//

def Builtin_FloatTF32 : Builtin_CachedFloatType<"FloatTF32", "tf32"> {
let summary = "TF32 floating-point type";
}

//===----------------------------------------------------------------------===//
// Float32Type
//===----------------------------------------------------------------------===//

def Builtin_Float32 : Builtin_CachedFloatType<"Float32", "f32",
/*declaredInterfaceMethods=*/["scaleElementBitwidth"]> {
Expand All @@ -362,20 +377,23 @@ def Builtin_Float32 : Builtin_CachedFloatType<"Float32", "f32",

//===----------------------------------------------------------------------===//
// Float64Type
//===----------------------------------------------------------------------===//

def Builtin_Float64 : Builtin_CachedFloatType<"Float64", "f64"> {
let summary = "64-bit floating-point type";
}

//===----------------------------------------------------------------------===//
// Float80Type
//===----------------------------------------------------------------------===//

def Builtin_Float80 : Builtin_CachedFloatType<"Float80", "f80"> {
let summary = "80-bit floating-point type";
}

//===----------------------------------------------------------------------===//
// Float128Type
//===----------------------------------------------------------------------===//

def Builtin_Float128 : Builtin_CachedFloatType<"Float128", "f128"> {
let summary = "128-bit floating-point type";
Expand Down
6 changes: 6 additions & 0 deletions mlir/include/mlir/IR/CommonAttrConstraints.td
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ include "mlir/IR/DialectBase.td"

//===----------------------------------------------------------------------===//
// Base attribute definition
//===----------------------------------------------------------------------===//

// Base class for all attributes.
class Attr<Pred condition, string summary = ""> :
Expand Down Expand Up @@ -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> :
Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -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> {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions mlir/include/mlir/IR/CommonTypeConstraints.td
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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> :
Expand Down
1 change: 1 addition & 0 deletions mlir/include/mlir/IR/EnumAttr.td
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
10 changes: 10 additions & 0 deletions mlir/include/mlir/IR/OpDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ class TraitBase {

//===----------------------------------------------------------------------===//
// Operand Traits
//===----------------------------------------------------------------------===//

namespace detail {
/// Utility trait base that provides accessors for derived traits that have
Expand Down Expand Up @@ -514,6 +515,7 @@ class VariadicOperands

//===----------------------------------------------------------------------===//
// Region Traits
//===----------------------------------------------------------------------===//

/// This class provides verification for ops that are known to have zero
/// regions.
Expand Down Expand Up @@ -606,6 +608,7 @@ class VariadicRegions

//===----------------------------------------------------------------------===//
// Result Traits
//===----------------------------------------------------------------------===//

/// This class provides return value APIs for ops that are known to have
/// zero results.
Expand Down Expand Up @@ -757,6 +760,7 @@ class VariadicResults

//===----------------------------------------------------------------------===//
// Terminator Traits
//===----------------------------------------------------------------------===//

/// This class indicates that the regions associated with this op don't have
/// terminators.
Expand Down Expand Up @@ -868,6 +872,7 @@ class VariadicSuccessors

//===----------------------------------------------------------------------===//
// SingleBlock
//===----------------------------------------------------------------------===//

/// This class provides APIs and verifiers for ops with regions having a single
/// block.
Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1514,6 +1521,7 @@ bool hasElementwiseMappableTraits(Operation *op);
namespace op_definition_impl {
//===----------------------------------------------------------------------===//
// Trait Existence
//===----------------------------------------------------------------------===//

/// Returns true if this given Trait ID matches the IDs of any of the provided
/// trait types `Traits`.
Expand All @@ -1532,6 +1540,7 @@ inline bool hasTrait<>(TypeID traitID) {

//===----------------------------------------------------------------------===//
// Trait Folding
//===----------------------------------------------------------------------===//

/// Trait to check if T provides a 'foldTrait' method for single result
/// operations.
Expand Down Expand Up @@ -1604,6 +1613,7 @@ static LogicalResult foldTraits(Operation *op, ArrayRef<Attribute> operands,

//===----------------------------------------------------------------------===//
// Trait Verification
//===----------------------------------------------------------------------===//

/// Trait to check if T provides a `verifyTrait` method.
template <typename T, typename... Args>
Expand Down
Loading