Class PullAsMemRefOp

Inheritance Relationships

Base Type

  • public mlir::Op< PullAsMemRefOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::MemRefType >::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::OpAsmOpInterface::Trait >

Class Documentation

class PullAsMemRefOp : public mlir::Op<PullAsMemRefOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::MemRefType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::OpAsmOpInterface::Trait>

Public Types

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

Public Functions

inline ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames()
inline std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index)
inline ::mlir::Operation::operand_range getODSOperands(unsigned index)
inline ::mlir::TypedValue<::mlir::dfg::OutputType> getReadPort()
inline ::mlir::OpOperand &getReadPortMutable()
inline std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index)
inline ::mlir::Operation::result_range getODSResults(unsigned index)
inline ::mlir::TypedValue<::mlir::MemRefType> getTokenMemref()
void print(::mlir::OpAsmPrinter &p)

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

Emits readPort : portType; the memref result type is implicit.

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

Verifies that the source port is shaped.

Mirrors PullAsTensorOp::verify; pulling a scalar port as a memref is rejected as a hard error.

void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)

Assigns a pretty name to the memref result of a dfg::PullAsMemRefOp.

The result is named token_memrefN where N is the count of PullAsMemRefOps preceding this one inside the enclosing DFG node, following the same walk-and-count strategy used by PullOp.

Public Static Functions

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 void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value readPort)

Builds a dfg::PullAsMemRefOp that reads an entire shaped port as a ranked memref.

The result type is a MemRefType whose shape and element type are taken from the dfg::OutputType of readPort.

Parameters:

readPort – The shaped dfg::OutputType port to read; scalar ports are rejected by verify.

static PullAsMemRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value readPort)
static PullAsMemRefOp create(::mlir::ImplicitLocOpBuilder &builder, Value readPort)
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)

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

The expected syntax is:

`dfg.pull_as_memref` %readPort `:` port-type

Mirrors PullAsTensorOp::parse; the memref result type is derived from the port type and is not written explicitly.

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

Public Static Attributes

static constexpr int odsIndex_read_port = 0