Class ExpressionOp

Inheritance Relationships

Base Type

  • public mlir::Op< ExpressionOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type >::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::NoRegionArguments, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator< YieldOp >::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpAsmOpInterface::Trait >

Class Documentation

class ExpressionOp : public mlir::Op<ExpressionOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::NoRegionArguments, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpAsmOpInterface::Trait>

Public Types

using Adaptor = ExpressionOpAdaptor
template<typename RangeT>
using GenericAdaptor = ExpressionOpGenericAdaptor<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 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index)
inline ::mlir::Operation::result_range getODSResults(unsigned index)
inline ::mlir::TypedValue<::mlir::Type> getResult()
inline ::mlir::Region &getBody()
::llvm::LogicalResult verifyInvariantsImpl()
::llvm::LogicalResult verifyInvariants()
::llvm::LogicalResult verify()

Verifies an emithls::ExpressionOp has a consistent result type.

The type of the enclosing ExpressionOp must match the type of the value produced by the terminating YieldOp in its body.

void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)

Names the SSA result of an emithls::ExpressionOp.

Assigns a name of the form expr<N> (e.g. expr0, expr2) by counting how many ExpressionOps appear before this one in a pre-order walk of the nearest enclosing non-module ancestor, so names are stable within a function body regardless of nesting depth.

void print(::mlir::OpAsmPrinter &_odsPrinter)
inline Operation *getRootOp()

Returns the operation that defines the value to be yielded.

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, Type resultType, function_ref<void(OpBuilder&, Location)> bodyBuilder)

Builds an emithls::ExpressionOp with an inline body.

Creates a single-block region, invokes bodyBuilder to populate it, and registers resultType as the op’s result type.

Parameters:
  • resultType – The type produced by this expression.

  • bodyBuilder – Callback that emits ops into the expression body; receives the current builder and the op’s location.

static ExpressionOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Type resultType, function_ref<void(OpBuilder&, Location)> bodyBuilder)
static ExpressionOp create(::mlir::ImplicitLocOpBuilder &builder, Type resultType, function_ref<void(OpBuilder&, Location)> bodyBuilder)
static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context)

Canonicalization patterns for ExpressionOp.

  • InlinePureNestedExpression: flattens an ExpressionOp whose body consists solely of another ExpressionOp followed by a YieldOp by splicing the inner body into the outer block in place.

static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)