Class ChannelOp
Defined in File DFGOps.h.inc
Inheritance Relationships
Base Type
public mlir::Op< ChannelOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::NResults< 2 >::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::dfg::EdgeInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait >
Class Documentation
-
class ChannelOp : public mlir::Op<ChannelOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::NResults<2>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::dfg::EdgeInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait>
Public Types
-
using Adaptor = ChannelOpAdaptor
-
template<typename RangeT>
using GenericAdaptor = ChannelOpGenericAdaptor<RangeT>
-
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>
-
using Properties = FoldAdaptor::Properties
Public Functions
-
inline ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames()
-
inline ::mlir::StringAttr getBufferSizeAttrName()
-
inline ::mlir::StringAttr getTokenTypeAttrName()
-
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::TypedValue<::mlir::dfg::OutputType> getOutputPort()
-
void writeProperties(::mlir::DialectBytecodeWriter &writer)
-
inline ::mlir::TypeAttr getTokenTypeAttr()
-
::mlir::Type getTokenType()
-
inline ::mlir::IntegerAttr getBufferSizeAttr()
-
::std::optional<uint32_t> getBufferSize()
-
inline void setTokenTypeAttr(::mlir::TypeAttr attr)
-
void setTokenType(::mlir::Type attrValue)
-
inline void setBufferSizeAttr(::mlir::IntegerAttr attr)
-
void setBufferSize(::std::optional<uint32_t> attrValue)
-
inline ::mlir::Attribute removeBufferSizeAttr()
-
void print(::mlir::OpAsmPrinter &p)
Prints a
dfg::ChannelOpin the custom assembly syntax consumed byparse.Emits
(bufferSize) : dimensionList x tokenType. The buffer-size integer is omitted — leaving empty parentheses — when no explicit size is set. For shaped channels the dimension list is followed byxbefore the element type; for scalar channels both the shape and the separator are suppressed.
-
::llvm::LogicalResult verifyInvariantsImpl()
-
::llvm::LogicalResult verifyInvariants()
-
::llvm::LogicalResult verify()
Verifies that both ports of the channel are in use.
A channel whose input port or output port has no uses represents a dangling endpoint that will never transfer data. This condition is reported as a warning rather than an error to permit incremental IR construction where port connectivity is established in a later step.
-
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Assigns pretty names to the two results of a
dfg::ChannelOp.The input-port result is named
in_port_Nand the output-port resultout_port_N, where N is the zero-based index of this channel among allChannelOps defined earlier in the same block. The count is computed by walking the block until the current operation is reached, so names are stable and unique regardless of how many channels share a block.
-
inline Operation *getInputConnectedOp()
-
inline Operation *getOutputConnectedOp()
-
inline void getEffects(SmallVectorImpl<SideEffects::EffectInstance<MemoryEffects::Effect>> &effects)
Populates the memory-effect list required by MemoryEffectsOpInterface.
Both a Read and a Write effect are attached to the channel’s
input_portandoutput_portresults on the DefaultResource. This pair serves two purposes:Write marks the channel as a definition site for the FIFO buffer, preventing DCE from removing a channel that has no further SSA uses within the same block.
Read prevents CSE from merging two distinct channel declarations that happen to carry the same token type, since each channel is a unique, stateful FIFO object.
Together they conservatively model the channel as an opaque side-effecting operation, ensuring that standard canonicalization passes do not reorder, deduplicate, or eliminate channel declarations.
Public Static Functions
-
static inline ::mlir::StringAttr getBufferSizeAttrName(::mlir::OperationName name)
-
static inline ::mlir::StringAttr getTokenTypeAttrName(::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, ArrayRef<int64_t> shape, Type tokenType, std::optional<int32_t> bufferSize = std::nullopt)
-
static ChannelOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ArrayRef<int64_t> shape, Type tokenType, std::optional<int32_t> bufferSize = std::nullopt)
-
static ChannelOp create(::mlir::ImplicitLocOpBuilder &builder, ArrayRef<int64_t> shape, Type tokenType, std::optional<int32_t> bufferSize = std::nullopt)
-
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type type, std::optional<int32_t> bufferSize = std::nullopt)
-
static ChannelOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Type type, std::optional<int32_t> bufferSize = std::nullopt)
-
static ChannelOp create(::mlir::ImplicitLocOpBuilder &builder, Type type, std::optional<int32_t> bufferSize = std::nullopt)
-
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Parses a
dfg::ChannelOpfrom its custom assembly syntax.The expected syntax is:
`dfg.channel` `(` bufferSize? `)` `:` dimension-list token-type
The parenthesised integer is optional; when omitted, the buffer-size attribute is stored as 0 to indicate an unbounded channel. The dimension list uses the standard
x-separated dimension form and may be empty for scalar channels. The two result types are derived from the parsed shape and token type and do not appear explicitly in the source text.
-
static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
-
using Adaptor = ChannelOpAdaptor