Class LoopOp
Defined in File DFGOps.h.inc
Inheritance Relationships
Base Type
public mlir::Op< LoopOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::NoTerminator, ::mlir::OpTrait::HasParent< ProcessOp >::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::AutomaticAllocationScope, ::mlir::OpTrait::HasRecursiveMemoryEffects >
Class Documentation
-
class LoopOp : public mlir::Op<LoopOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::NoTerminator, ::mlir::OpTrait::HasParent<ProcessOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::AutomaticAllocationScope, ::mlir::OpTrait::HasRecursiveMemoryEffects>
Public Types
-
using Adaptor = LoopOpAdaptor
-
template<typename RangeT>
using GenericAdaptor = LoopOpGenericAdaptor<RangeT>
-
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>
-
using Properties = FoldAdaptor::Properties
Public Functions
-
inline ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames()
-
inline ::mlir::StringAttr getOperandSegmentSizesAttrName()
-
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index)
-
inline ::mlir::Operation::operand_range getODSOperands(unsigned index)
-
inline ::mlir::Operation::operand_range getInputChannels()
-
inline ::mlir::Operation::operand_range getOutputChannels()
-
::mlir::MutableOperandRange getInputChannelsMutable()
-
::mlir::MutableOperandRange getOutputChannelsMutable()
-
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)
-
void print(::mlir::OpAsmPrinter &p)
Prints a
dfg::LoopOpin the custom assembly syntax consumed byparse.If any input channel operands are present the
inputs(...)clause is emitted, followed by theoutputs(...)clause for output channels. Within each clause every operand is printed asvalue : type. The body region is always printed since aLoopOpwithout a region is ill-formed.
-
::llvm::LogicalResult verifyInvariantsImpl()
-
::llvm::LogicalResult verifyInvariants()
-
::llvm::LogicalResult verify()
Verifies that the
dfg::LoopOphas a valid port mapping.A
LoopOpmust monitor either all input ports of its parentProcessOpor none of them, and likewise for output ports. Partial coverage — monitoring only a subset — is rejected to avoid ambiguity in scheduling semantics where the loop body would need to fire on an undefined subset of channels.
-
inline FunctionType getFunctionType()
Constructs a function type from the inputs/outputs types.
Public Static Functions
-
static inline ::mlir::StringAttr getOperandSegmentSizesAttrName(::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, ValueRange inputChannels, ValueRange outputChannels, function_ref<void(OpBuilder&, Location)> bodyBuilder)
Builds a LoopOp with the given input, output values, and body.
The region is always created.
bodyBuilderis called immediately with the builder positioned at the entry block, so callers can populate the body inline.- Parameters:
inputChannels – Values that are used as inputs.
outputChannels – Values that are used as outputs.
bodyBuilder – Callback to fill the entry block, can’t be null.
-
static LoopOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ValueRange inputChannels, ValueRange outputChannels, function_ref<void(OpBuilder&, Location)> bodyBuilder)
-
static LoopOp create(::mlir::ImplicitLocOpBuilder &builder, ValueRange inputChannels, ValueRange outputChannels, function_ref<void(OpBuilder&, Location)> bodyBuilder)
-
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Parses a
dfg::LoopOpfrom its custom assembly syntax.The expected syntax is:
`dfg.loop` (`inputs` `(` operand-list `)`)? (`outputs` `(` operand-list `)`)? region
Unlike
ProcessOp, where ports are declared as fresh block arguments,LoopOprefers to channel values already live in the enclosing process body. Theinputs/outputslists are therefore parsed as resolved operands (ssaName : type) rather than new argument declarations. TheoperandSegmentSizesattribute is derived from the parsed counts and stored automatically. The body region is mandatory and must be non-empty.
-
static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
-
using Adaptor = LoopOpAdaptor