MLIR  14.0.0git
Public Member Functions | Public Attributes | List of all members
mlir::OperationState Struct Reference

This represents an operation in an abstracted form, suitable for use with the builder APIs. More...

#include "mlir/IR/OperationSupport.h"

Collaboration diagram for mlir::OperationState:
Collaboration graph
[legend]

Public Member Functions

 OperationState (Location location, StringRef name)
 
 OperationState (Location location, OperationName name)
 
 OperationState (Location location, OperationName name, ValueRange operands, TypeRange types, ArrayRef< NamedAttribute > attributes, BlockRange successors={}, MutableArrayRef< std::unique_ptr< Region >> regions={})
 
 OperationState (Location location, StringRef name, ValueRange operands, TypeRange types, ArrayRef< NamedAttribute > attributes, BlockRange successors={}, MutableArrayRef< std::unique_ptr< Region >> regions={})
 
void addOperands (ValueRange newOperands)
 
void addTypes (ArrayRef< Type > newTypes)
 
template<typename RangeT >
std::enable_if_t<!std::is_convertible< RangeT, ArrayRef< Type > >::valueaddTypes (RangeT &&newTypes)
 
void addAttribute (StringRef name, Attribute attr)
 Add an attribute with the specified name. More...
 
void addAttribute (StringAttr name, Attribute attr)
 Add an attribute with the specified name. More...
 
void addAttributes (ArrayRef< NamedAttribute > newAttributes)
 Add an array of named attributes. More...
 
void addSuccessors (Block *successor)
 
void addSuccessors (BlockRange newSuccessors)
 
RegionaddRegion ()
 Create a region that should be attached to the operation. More...
 
void addRegion (std::unique_ptr< Region > &&region)
 Take a region that should be attached to the Operation. More...
 
void addRegions (MutableArrayRef< std::unique_ptr< Region >> regions)
 Take ownership of a set of regions that should be attached to the Operation. More...
 
MLIRContextgetContext () const
 Get the context held by this operation state. More...
 

Public Attributes

Location location
 
OperationName name
 
SmallVector< Value, 4 > operands
 
SmallVector< Type, 4 > types
 Types of the results of this operation. More...
 
NamedAttrList attributes
 
SmallVector< Block *, 1 > successors
 Successors of this operation and their respective operands. More...
 
SmallVector< std::unique_ptr< Region >, 1 > regions
 Regions that the op will hold. More...
 

Detailed Description

This represents an operation in an abstracted form, suitable for use with the builder APIs.

This object is a large and heavy weight object meant to be used as a temporary object on the stack. It is generally unwise to put this in a collection.

Definition at line 569 of file OperationSupport.h.

Constructor & Destructor Documentation

◆ OperationState() [1/4]

OperationState::OperationState ( Location  location,
StringRef  name 
)

Definition at line 167 of file OperationSupport.cpp.

◆ OperationState() [2/4]

OperationState::OperationState ( Location  location,
OperationName  name 
)

Definition at line 170 of file OperationSupport.cpp.

◆ OperationState() [3/4]

OperationState::OperationState ( Location  location,
OperationName  name,
ValueRange  operands,
TypeRange  types,
ArrayRef< NamedAttribute attributes,
BlockRange  successors = {},
MutableArrayRef< std::unique_ptr< Region >>  regions = {} 
)

Definition at line 173 of file OperationSupport.cpp.

References regions.

◆ OperationState() [4/4]

OperationState::OperationState ( Location  location,
StringRef  name,
ValueRange  operands,
TypeRange  types,
ArrayRef< NamedAttribute attributes,
BlockRange  successors = {},
MutableArrayRef< std::unique_ptr< Region >>  regions = {} 
)

Definition at line 186 of file OperationSupport.cpp.

Member Function Documentation

◆ addAttribute() [1/2]

void mlir::OperationState::addAttribute ( StringRef  name,
Attribute  attr 
)
inline

Add an attribute with the specified name.

Definition at line 606 of file OperationSupport.h.

Referenced by addArgAndResultAttrsImpl(), mlir::AffineDmaStartOp::build(), mlir::AffineDmaWaitOp::build(), buildAvgPool2dOpWithQuantInfo(), buildConvOpWithQuantInfo(), buildExplicitValuePadOpWithQuantInfo(), buildFCOpWithQuantInfo(), buildMatMulOpWithQuantInfo(), buildPadOpWithQuantInfo(), buildTransConvOpWithQuantInfo(), buildUnaryOpWithQuantInfo(), computeReshapeCollapsedType(), computeTensorReshapeCollapsedType(), findKnownStructIndices(), mlir::AffineDmaWaitOp::fold(), foldTransferInBoundsAttribute(), getUnnamedAddrAttrName(), inferExtractOpResultType(), inferStridedSliceOpResultType(), FoldLaunchArguments::matchAndRewrite(), mlirOperationCreate(), parseAffineForOp(), parseAffineParallelOp(), parseAffinePrefetchOp(), parseAtomicUpdateOp(), parseBound(), parseBranchConditionalOp(), parseClauseAttr(), parseClauses(), parseCommonStructuredOpParts(), parseConstShapeOp(), parseContractionOp(), parseControlAttribute(), parseEntryPointOp(), parseEnumKeywordAttr(), parseEnumStrAttr(), parseExecuteOp(), parseExecutionModeOp(), parseFenceOp(), parseFuncOp(), mlir::function_interface_impl::parseFunctionOp(), parseGlobalOp(), parseGlobalVariableOp(), parseGPUFuncOp(), parseIncludeOp(), parseInvokeOp(), parseLandingpadOp(), parseLLVMFuncOp(), parseLoadOp(), parseLoopOp(), parseParallelOp(), parsePrefetchOp(), mlir::parseReshapeLikeOp(), parseSectionsOp(), parseShuffleVectorOp(), parseSpecConstantCompositeOp(), parseStoreOp(), parseTiledLoopOp(), parseTransferReadOp(), parseTransposeOp(), parseVariableOp(), parseWsLoopOp(), print(), printLaunchFuncOperands(), verify(), and verifyReductionOp().

◆ addAttribute() [2/2]

void mlir::OperationState::addAttribute ( StringAttr  name,
Attribute  attr 
)
inline

Add an attribute with the specified name.

Definition at line 611 of file OperationSupport.h.

◆ addAttributes()

void mlir::OperationState::addAttributes ( ArrayRef< NamedAttribute newAttributes)
inline

◆ addOperands()

void OperationState::addOperands ( ValueRange  newOperands)

◆ addRegion() [1/2]

Region * OperationState::addRegion ( )

◆ addRegion() [2/2]

void OperationState::addRegion ( std::unique_ptr< Region > &&  region)

Take a region that should be attached to the Operation.

The body of the region will be transferred when the Operation is constructed. If the region is null, a new empty region will be attached to the Operation.

Definition at line 207 of file OperationSupport.cpp.

References regions.

◆ addRegions()

void OperationState::addRegions ( MutableArrayRef< std::unique_ptr< Region >>  regions)

Take ownership of a set of regions that should be attached to the Operation.

Definition at line 211 of file OperationSupport.cpp.

References addRegion(), and regions.

◆ addSuccessors() [1/2]

void mlir::OperationState::addSuccessors ( Block successor)
inline

◆ addSuccessors() [2/2]

void OperationState::addSuccessors ( BlockRange  newSuccessors)

Definition at line 198 of file OperationSupport.cpp.

References successors.

◆ addTypes() [1/2]

void mlir::OperationState::addTypes ( ArrayRef< Type newTypes)
inline

◆ addTypes() [2/2]

template<typename RangeT >
std::enable_if_t<!std::is_convertible<RangeT, ArrayRef<Type> >::value> mlir::OperationState::addTypes ( RangeT &&  newTypes)
inline

Definition at line 601 of file OperationSupport.h.

◆ getContext()

MLIRContext* mlir::OperationState::getContext ( ) const
inline

Get the context held by this operation state.

Definition at line 638 of file OperationSupport.h.

References mlir::Attribute::getContext().

Referenced by mlir::Operation::create(), inferOperationTypes(), parseContractionOp(), parseExecuteOp(), and parseOuterProductOp().

Member Data Documentation

◆ attributes

NamedAttrList mlir::OperationState::attributes

Definition at line 575 of file OperationSupport.h.

Referenced by mlir::Operation::create(), foldTransferInBoundsAttribute(), getUnnamedAddrAttrName(), inferOperationTypes(), mlirOperationCreate(), mlir::AffineDmaStartOp::parse(), mlir::AffineDmaWaitOp::parse(), parseAffineApplyOp(), parseAffineForOp(), parseAffineIfOp(), parseAffineLoadOp(), parseAffineMinMaxOp(), parseAffineParallelOp(), parseAffinePrefetchOp(), parseAffineStoreOp(), parseAffineVectorLoadOp(), parseAffineVectorStoreOp(), parseAllocaOp(), parseAllocaScopeOp(), parseAssumingOp(), parseAtomicCmpXchgOp(), parseAtomicRMWOp(), parseBound(), parseCallOp(), mlir::impl::parseCastOp(), parseCommonStructuredOpParts(), parseCompositeExtractOp(), parseCompositeInsertOp(), parseConstantOp(), parseConstShapeOp(), parseContractionOp(), parseCopyMemoryOp(), parseEntryPointOp(), parseExecuteRegionOp(), parseExecutionModeOp(), parseExtractElementOp(), parseExtractOp(), parseExtractValueOp(), parseFenceOp(), parseForEachOp(), parseForOp(), parseFuncOp(), parseFunctionLibraryOp(), mlir::function_interface_impl::parseFunctionOp(), parseGenericAtomicRMWOp(), parseGenericOp(), parseGlobalOp(), parseGlobalVariableOp(), parseGPUFuncOp(), parseGPUModuleOp(), parseIfOp(), parseIncludeOp(), parseInsertElementOp(), parseInsertValueOp(), parseInvokeOp(), parseLaunchOp(), parseLoadOp(), parseLoopOp(), parseMemoryAccessAttributes(), parseModuleOp(), parseNVVMVoteBallotOp(), mlir::impl::parseOneResultSameOperandTypeOp(), parseOuterProductOp(), parseParallelOp(), parsePrefetchOp(), parseReduceOp(), parseReductionOp(), mlir::parseReshapeLikeOp(), parseReturnOp(), parseSelectOp(), parseShuffleOp(), parseShuffleVectorOp(), parseSourceMemoryAccessAttributes(), parseSpecConstantCompositeOp(), parseSpecConstantOp(), parseSpecConstantOperationOp(), parseStoreOp(), parseTiledLoopOp(), parseTransferReadOp(), parseTransposeOp(), parseVariableDecorations(), parseViewOp(), parseYieldOp(), print(), and verify().

◆ location

Location mlir::OperationState::location

◆ name

OperationName mlir::OperationState::name

◆ operands

SmallVector<Value, 4> mlir::OperationState::operands

Definition at line 572 of file OperationSupport.h.

Referenced by addOperands(), mlir::Operation::create(), foldTransferInBoundsAttribute(), inferOperationTypes(), mlir::AffineDmaStartOp::parse(), mlir::AffineDmaWaitOp::parse(), parseAccessChainOp(), parseAffineApplyOp(), parseAffineForOp(), parseAffineIfOp(), parseAffineLoadOp(), parseAffineMinMaxOp(), parseAffinePrefetchOp(), parseAffineStoreOp(), parseAffineVectorLoadOp(), parseAffineVectorStoreOp(), parseAllocaOp(), parseAssumingOp(), parseAtomicCmpXchgOp(), parseAtomicCompareExchangeImpl(), parseAtomicExchangeOp(), parseAtomicReadOp(), parseAtomicRMWOp(), parseAtomicUpdateOp(), parseAtomicWriteOp(), parseBound(), parseBranchConditionalOp(), parseCallOp(), mlir::impl::parseCastOp(), parseClauses(), parseCommonStructuredOpParts(), parseCompositeConstructOp(), parseCompositeExtractOp(), parseCompositeInsertOp(), parseContractionOp(), parseCooperativeMatrixLoadNVOp(), parseCooperativeMatrixStoreNVOp(), parseCopyMemoryOp(), parseDmaStartOp(), parseExecuteOp(), parseExtractElementOp(), parseExtractOp(), parseExtractValueOp(), parseForEachOp(), parseForOp(), parseGenericAtomicRMWOp(), parseGroupNonUniformArithmeticOp(), parseIfOp(), parseInsertElementOp(), parseInsertValueOp(), parseInvokeOp(), parseLandingpadOp(), parseLaunchOp(), parseLoadOp(), parseLogicalBinaryOp(), parseLogicalUnaryOp(), parseNVVMVoteBallotOp(), mlir::impl::parseOneResultSameOperandTypeOp(), parseOperandAndType(), parseOperandList(), parseOptionalOperand(), parseOuterProductOp(), parseParallelOp(), parsePrefetchOp(), parsePtrAccessChainOpImpl(), parseReduceOp(), parseReductionOp(), mlir::parseReshapeLikeOp(), parseReturnOp(), parseROCDLMubufLoadOp(), parseROCDLMubufStoreOp(), parseSelectOp(), parseShiftOp(), parseShuffleOp(), parseShuffleVectorOp(), parseStoreOp(), parseSubgroupBlockReadINTELOp(), parseSubgroupBlockWriteINTELOp(), parseTiledLoopOp(), parseTransferReadOp(), parseTransposeOp(), parseUnaryOp(), parseVariableOp(), parseViewOp(), parseWsLoopOp(), parseYieldOp(), mlir::replaceAllMemRefUsesWith(), and verify().

◆ regions

SmallVector<std::unique_ptr<Region>, 1> mlir::OperationState::regions

◆ successors

SmallVector<Block *, 1> mlir::OperationState::successors

Successors of this operation and their respective operands.

Definition at line 577 of file OperationSupport.h.

Referenced by addSuccessors(), and mlir::Operation::create().

◆ types

SmallVector<Type, 4> mlir::OperationState::types

The documentation for this struct was generated from the following files: