Class ProcessOp

Inheritance Relationships

Base Type

  • public mlir::Op< ProcessOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent< ModuleOp >::Impl, ::mlir::OpTrait::NoTerminator, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::dfg::NodeInterface::Trait, ::mlir::OpTrait::AffineScope, ::mlir::OpTrait::AutomaticAllocationScope, ::mlir::OpTrait::IsIsolatedFromAbove, ::mlir::OpAsmOpInterface::Trait >

Class Documentation

class ProcessOp : public mlir::Op<ProcessOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent<ModuleOp>::Impl, ::mlir::OpTrait::NoTerminator, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::dfg::NodeInterface::Trait, ::mlir::OpTrait::AffineScope, ::mlir::OpTrait::AutomaticAllocationScope, ::mlir::OpTrait::IsIsolatedFromAbove, ::mlir::OpAsmOpInterface::Trait>

Public Types

using Adaptor = ProcessOpAdaptor
template<typename RangeT>
using GenericAdaptor = ProcessOpGenericAdaptor<RangeT>
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>
using Properties = FoldAdaptor::Properties

Public Functions

inline ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames()
inline ::mlir::StringAttr getFunctionTypeAttrName()
inline ::mlir::StringAttr getMultiplicityAttrName()
inline ::mlir::StringAttr getSymNameAttrName()
inline std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index)
inline ::mlir::Operation::operand_range getODSOperands(unsigned index)
inline std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index)
inline ::mlir::Operation::result_range getODSResults(unsigned index)
inline ::mlir::Region &getBody()
void writeProperties(::mlir::DialectBytecodeWriter &writer)
inline ::mlir::StringAttr getSymNameAttr()
::llvm::StringRef getSymName()
inline ::mlir::TypeAttr getFunctionTypeAttr()
::mlir::FunctionType getFunctionType()
inline ::mlir::DenseI64ArrayAttr getMultiplicityAttr()
::llvm::ArrayRef<int64_t> getMultiplicity()
inline void setSymNameAttr(::mlir::StringAttr attr)
void setSymName(::llvm::StringRef attrValue)
inline void setFunctionTypeAttr(::mlir::TypeAttr attr)
void setFunctionType(::mlir::FunctionType attrValue)
inline void setMultiplicityAttr(::mlir::DenseI64ArrayAttr attr)
void setMultiplicity(::llvm::ArrayRef<int64_t> attrValue)
void print(::mlir::OpAsmPrinter &p)

Prints a dfg::ProcessOp in the custom assembly syntax consumed by parse.

The symbol name is printed first, followed by the inputs(...) clause if the process has any input ports, then the outputs(...) clause if it has any output ports. Within each clause, every port is printed as name : type. For concrete (non-external) processes the SSA value names come from the body region’s block arguments; for external (declaration-only) processes synthetic names arg0, arg1, … are emitted instead since there is no region to source names from.

The sym_name and function_type attributes are always elided from the optional attribute dictionary because they are already encoded in the symbol name and the inputs/outputs clauses respectively. An empty multiplicity array attribute is also elided to keep the output clean. The body region is only printed for concrete processes; external processes have no region and are therefore printed as bare declarations.

::llvm::LogicalResult verifyInvariantsImpl()
::llvm::LogicalResult verifyInvariants()
::llvm::LogicalResult verify()

Verifies if the process is correct.

All input ports should be of type dfg::OutputType and output ports of type dfg::InputType.

If there is multiplicity, its size should match the number of arguments in this process.

void getAsmBlockArgumentNames(::mlir::Region &region, ::mlir::OpAsmSetValueNameFn setNameFn)

Names the block arguments of the ProcessOp body region.

The entry block carries a flat argument list that holds all input port arguments followed by all output port arguments. This callback assigns human-readable SSA names so that printed IR uses in0, in1, … for input ports and out0, out1, … for output ports, making the argument list easier to read than the default arg0, arg1, … scheme. The split point between the two groups is determined by the number of inputs reported by the stored FunctionType.

inline std::string getNodeName()
inline unsigned getNumInputPorts()
inline Value getInputPort(unsigned index)
inline SmallVector<Type> getInputPortTypes()

Returns a vector of base types of the input ports.

inline SmallVector<Value> getInputPorts()
inline unsigned getNumOutputPorts()
inline Value getOutputPort(unsigned index)
inline SmallVector<Type> getOutputPortTypes()

Returns a vector of base types of the output ports.

inline SmallVector<Value> getOutputPorts()
inline bool isDeclaration()
inline bool isExternal()

Returns whether the process is externally defined.

Public Static Functions

static inline ::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name)
static inline ::mlir::StringAttr getMultiplicityAttrName(::mlir::OperationName name)
static inline ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
static inline constexpr ::llvm::StringLiteral getOperationName()
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)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, StringRef name, FunctionType functionType, ArrayRef<int64_t> multiplicity = {}, function_ref<void(OpBuilder&, Location, ValueRange)> bodyBuilder = nullptr)

Builds a ProcessOp with the given name, port types, and body.

Input and output types in functionType are automatically wrapped in the corresponding DFG channel types if they are not already:

The region is always created. If bodyBuilder is provided it is called immediately with the builder positioned at the entry block, so callers can populate the body inline.

Parameters:
  • name – Symbol name of the process (must be unique in the module).

  • functionType – Port signature before DFG-type wrapping.

  • multiplicity – Per-port firing multiplicity; empty means all-ones.

  • bodyBuilder – Optional callback to fill the entry block; may be null.

static ProcessOp create(::mlir::OpBuilder &builder, ::mlir::Location location, StringRef name, FunctionType functionType, ArrayRef<int64_t> multiplicity = {}, function_ref<void(OpBuilder&, Location, ValueRange)> bodyBuilder = nullptr)
static ProcessOp create(::mlir::ImplicitLocOpBuilder &builder, StringRef name, FunctionType functionType, ArrayRef<int64_t> multiplicity = {}, function_ref<void(OpBuilder&, Location, ValueRange)> bodyBuilder = nullptr)
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)

Parses a dfg::ProcessOp from its custom assembly syntax.

The expected syntax is:

`dfg.process` @name
  (`inputs` `(` arg-list `)`)?
  (`outputs` `(` arg-list `)`)?
  (`attributes` attr-dict)?
  region?

The inputs and outputs keyword-prefixed argument lists are parsed separately so the two groups can be distinguished when reconstructing the FunctionType attribute: input types become the function’s argument types and output types become its result types. Both argument lists are then merged into a single flat list that becomes the entry block arguments of the attached body region.

An absent region indicates an external (declaration-only) process; a present but empty region is rejected as ill-formed. The sym_name and function_type attributes are populated directly during parsing and are therefore not expected to appear in the optional attribute dictionary.

static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context)

Canonicalization patterns for ProcessOp.

  • EliminateDeadProcess: Erases the process if it’s not instantiated any where in the IR.

static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)