Files
gps/tools/local/circt/include/mlir/IR/BuiltinOps.h.inc
T
2026-07-12 11:01:51 +03:00

504 lines
22 KiB
C++

/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* Op Declarations *|
|* *|
|* Automatically generated file, do not edit! *|
|* From: BuiltinOps.td *|
|* *|
\*===----------------------------------------------------------------------===*/
namespace mlir {
/// A top level container operation
/// A `module` represents a top-level container operation. It contains a single
/// [graph region](../LangRef.md#control-flow-and-ssacfg-regions) containing a single block
/// which can contain any operations and does not have a terminator. Operations
/// within this region cannot implicitly capture values defined outside the module,
/// i.e. Modules are [IsolatedFromAbove](../Traits#isolatedfromabove). Modules have
/// an optional [symbol name](../SymbolsAndSymbolTables.md) which can be used to refer
/// to them in operations.
///
/// Example:
///
/// ```mlir
/// module {
/// func.func @foo()
/// }
/// ```
class ModuleOp;
} // namespace mlir
namespace mlir {
/// An unrealized conversion from one set of types to another
/// An `unrealized_conversion_cast` operation represents an unrealized
/// conversion from one set of types to another, that is used to enable the
/// inter-mixing of different type systems. This operation should not be
/// attributed any special representational or execution semantics, and is
/// generally only intended to be used to satisfy the temporary intermixing of
/// type systems during the conversion of one type system to another.
///
/// This operation may produce results of arity 1-N, and accept as input
/// operands of arity 0-N.
///
/// Example:
///
/// ```mlir
/// // An unrealized 0-1 conversion. These types of conversions are useful in
/// // cases where a type is removed from the type system, but not all uses have
/// // been converted. For example, imagine we have a tuple type that is
/// // expanded to its element types. If only some uses of an empty tuple type
/// // instance are converted we still need an instance of the tuple type, but
/// // have no inputs to the unrealized conversion.
/// %result = unrealized_conversion_cast to !bar.tuple_type<>
///
/// // An unrealized 1-1 conversion.
/// %result1 = unrealized_conversion_cast %operand : !foo.type to !bar.lowered_type
///
/// // An unrealized 1-N conversion.
/// %results2:2 = unrealized_conversion_cast %tuple_operand : !foo.tuple_type<!foo.type, !foo.type> to !foo.type, !foo.type
///
/// // An unrealized N-1 conversion.
/// %result3 = unrealized_conversion_cast %operand, %operand : !foo.type, !foo.type to !bar.tuple_type<!foo.type, !foo.type>
/// ```
class UnrealizedConversionCastOp;
} // namespace mlir
#ifdef GET_OP_CLASSES
#undef GET_OP_CLASSES
namespace mlir {
//===----------------------------------------------------------------------===//
// ::mlir::ModuleOp declarations
//===----------------------------------------------------------------------===//
namespace detail {
class ModuleOpGenericAdaptorBase {
public:
struct Properties {
using sym_nameTy = ::mlir::StringAttr;
sym_nameTy sym_name;
auto getSymName() const {
auto &propStorage = this->sym_name;
return ::llvm::dyn_cast_or_null<::mlir::StringAttr>(propStorage);
}
void setSymName(const ::mlir::StringAttr &propValue) {
this->sym_name = propValue;
}
using sym_visibilityTy = ::mlir::StringAttr;
sym_visibilityTy sym_visibility;
auto getSymVisibility() const {
auto &propStorage = this->sym_visibility;
return ::llvm::dyn_cast_or_null<::mlir::StringAttr>(propStorage);
}
void setSymVisibility(const ::mlir::StringAttr &propValue) {
this->sym_visibility = propValue;
}
bool operator==(const Properties &rhs) const {
return
rhs.sym_name == this->sym_name &&
rhs.sym_visibility == this->sym_visibility &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
ModuleOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("builtin.module", odsAttrs.getContext());
}
ModuleOpGenericAdaptorBase(ModuleOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
return {index, 1};
}
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::StringAttr getSymNameAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::StringAttr>(getProperties().sym_name);
return attr;
}
::std::optional< ::llvm::StringRef > getSymName();
::mlir::StringAttr getSymVisibilityAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::StringAttr>(getProperties().sym_visibility);
return attr;
}
::std::optional< ::llvm::StringRef > getSymVisibility();
::mlir::Region &getBodyRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
} // namespace detail
template <typename RangeT>
class ModuleOpGenericAdaptor : public detail::ModuleOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::ModuleOpGenericAdaptorBase;
public:
ModuleOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
ModuleOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ModuleOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
ModuleOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ModuleOpGenericAdaptor(values, attrs, Properties{}, {}) {}
ModuleOpGenericAdaptor(RangeT values, const ModuleOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
template <typename LateInst = ModuleOp, typename = std::enable_if_t<std::is_same_v<LateInst, ModuleOp>>>
ModuleOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class ModuleOpAdaptor : public ModuleOpGenericAdaptor<::mlir::ValueRange> {
public:
using ModuleOpGenericAdaptor::ModuleOpGenericAdaptor;
ModuleOpAdaptor(ModuleOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class ModuleOp : public ::mlir::Op<ModuleOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::NoRegionArguments, ::mlir::OpTrait::NoTerminator, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::AffineScope, ::mlir::OpTrait::IsIsolatedFromAbove, ::mlir::OpTrait::SymbolTable, ::mlir::SymbolOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait, ::mlir::RegionKindInterface::Trait, ::mlir::OpTrait::HasOnlyGraphRegion> {
public:
using Op::Op;
using Op::print;
using Adaptor = ModuleOpAdaptor;
template <typename RangeT>
using GenericAdaptor = ModuleOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("sym_name"), ::llvm::StringRef("sym_visibility")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getSymNameAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getSymVisibilityAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getSymVisibilityAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("builtin.module");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return {index, 1};
}
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
return {index, 1};
}
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Region &getBodyRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::StringAttr getSymNameAttr() {
return ::llvm::dyn_cast_or_null<::mlir::StringAttr>(getProperties().sym_name);
}
::std::optional< ::llvm::StringRef > getSymName();
::mlir::StringAttr getSymVisibilityAttr() {
return ::llvm::dyn_cast_or_null<::mlir::StringAttr>(getProperties().sym_visibility);
}
::std::optional< ::llvm::StringRef > getSymVisibility();
void setSymNameAttr(::mlir::StringAttr attr) {
getProperties().sym_name = attr;
}
void setSymName(::std::optional<::llvm::StringRef> attrValue);
void setSymVisibilityAttr(::mlir::StringAttr attr) {
getProperties().sym_visibility = attr;
}
void setSymVisibility(::std::optional<::llvm::StringRef> attrValue);
::mlir::Attribute removeSymNameAttr() {
auto attr = getProperties().sym_name;
getProperties().sym_name = {};
return attr;
}
::mlir::Attribute removeSymVisibilityAttr() {
auto attr = getProperties().sym_visibility;
getProperties().sym_visibility = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, std::optional<StringRef> name = {});
static ModuleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, std::optional<StringRef> name = {});
static ModuleOp create(::mlir::ImplicitLocOpBuilder &builder, std::optional<StringRef> name = {});
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult verify();
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &_odsPrinter);
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
/// Construct a module from the given location with an optional name.
static ModuleOp create(Location loc, std::optional<StringRef> name = std::nullopt);
/// Return the name of this module if present.
std::optional<StringRef> getName() { return getSymName(); }
//===------------------------------------------------------------------===//
// SymbolOpInterface Methods
//===------------------------------------------------------------------===//
/// A ModuleOp may optionally define a symbol.
bool isOptionalSymbol() { return true; }
//===------------------------------------------------------------------===//
// DataLayoutOpInterface Methods
//===------------------------------------------------------------------===//
DataLayoutSpecInterface getDataLayoutSpec();
TargetSystemSpecInterface getTargetSystemSpec();
//===------------------------------------------------------------------===//
// OpAsmOpInterface Methods
//===------------------------------------------------------------------===//
static ::llvm::StringRef getDefaultDialect() {
return "builtin";
}
};
} // namespace mlir
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::ModuleOp)
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::detail::ModuleOpGenericAdaptorBase::Properties)
namespace mlir {
//===----------------------------------------------------------------------===//
// ::mlir::UnrealizedConversionCastOp declarations
//===----------------------------------------------------------------------===//
namespace detail {
class UnrealizedConversionCastOpGenericAdaptorBase {
public:
using Properties = ::mlir::EmptyProperties;
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
UnrealizedConversionCastOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("builtin.unrealized_conversion_cast", odsAttrs.getContext());
}
UnrealizedConversionCastOpGenericAdaptorBase(UnrealizedConversionCastOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
};
} // namespace detail
template <typename RangeT>
class UnrealizedConversionCastOpGenericAdaptor : public detail::UnrealizedConversionCastOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::UnrealizedConversionCastOpGenericAdaptorBase;
static constexpr int odsIndex_inputs = 0;
public:
UnrealizedConversionCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
UnrealizedConversionCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : UnrealizedConversionCastOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
UnrealizedConversionCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : UnrealizedConversionCastOpGenericAdaptor(values, attrs, Properties{}, {}) {}
UnrealizedConversionCastOpGenericAdaptor(RangeT values, const UnrealizedConversionCastOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
template <typename LateInst = UnrealizedConversionCastOp, typename = std::enable_if_t<std::is_same_v<LateInst, UnrealizedConversionCastOp>>>
UnrealizedConversionCastOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class UnrealizedConversionCastOpAdaptor : public UnrealizedConversionCastOpGenericAdaptor<::mlir::ValueRange> {
public:
using UnrealizedConversionCastOpGenericAdaptor::UnrealizedConversionCastOpGenericAdaptor;
UnrealizedConversionCastOpAdaptor(UnrealizedConversionCastOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class UnrealizedConversionCastOp : public ::mlir::Op<UnrealizedConversionCastOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = UnrealizedConversionCastOpAdaptor;
template <typename RangeT>
using GenericAdaptor = UnrealizedConversionCastOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
static constexpr int odsIndex_inputs = 0;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
return {};
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("builtin.unrealized_conversion_cast");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::MutableOperandRange getInputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getOutputs() {
return getODSResults(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
static UnrealizedConversionCastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
static UnrealizedConversionCastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
static UnrealizedConversionCastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
static UnrealizedConversionCastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult verify();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &_odsPrinter);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
public:
};
} // namespace mlir
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::UnrealizedConversionCastOp)
#endif // GET_OP_CLASSES