MLIR
15.0.0git
|
Operation is a basic unit of execution within MLIR. More...
#include "mlir/IR/Operation.h"
Classes | |
class | CloneOptions |
Class encompassing various options related to cloning an operation. More... | |
class | dialect_attr_iterator |
A utility iterator that filters out non-dialect attributes. More... | |
Public Types | |
using | operand_range = OperandRange |
using | operand_iterator = operand_range::iterator |
using | operand_type_iterator = operand_range::type_iterator |
using | operand_type_range = operand_range::type_range |
using | result_range = ResultRange |
Support result iteration. More... | |
using | result_iterator = result_range::iterator |
using | result_type_iterator = result_range::type_iterator |
Support result type iteration. More... | |
using | result_type_range = result_range::type_range |
using | dialect_attr_range = iterator_range< dialect_attr_iterator > |
using | succ_iterator = SuccessorRange::iterator |
using | use_iterator = result_range::use_iterator |
using | use_range = result_range::use_range |
using | user_iterator = ValueUserIterator< use_iterator, OpOperand > |
using | user_range = iterator_range< user_iterator > |
Public Member Functions | |
OperationName | getName () |
The name of an operation is the key identifier for it. More... | |
Optional< RegisteredOperationName > | getRegisteredInfo () |
If this operation has a registered operation description, return it. More... | |
bool | isRegistered () |
Returns true if this operation has a registered operation description, otherwise false. More... | |
void | erase () |
Remove this operation from its parent block and delete it. More... | |
void | remove () |
Remove the operation from its parent block, but don't delete it. More... | |
Operation * | clone (BlockAndValueMapping &mapper, CloneOptions options=CloneOptions::all()) |
Create a deep copy of this operation, remapping any operands that use values outside of the operation using the map that is provided (leaving them alone if no entry is present). More... | |
Operation * | clone (CloneOptions options=CloneOptions::all()) |
Operation * | cloneWithoutRegions (BlockAndValueMapping &mapper) |
Create a partial copy of this operation without traversing into attached regions. More... | |
Operation * | cloneWithoutRegions () |
Create a partial copy of this operation without traversing into attached regions. More... | |
Block * | getBlock () |
Returns the operation block that contains this operation. More... | |
MLIRContext * | getContext () |
Return the context this operation is associated with. More... | |
Dialect * | getDialect () |
Return the dialect this operation is associated with, or nullptr if the associated dialect is not loaded. More... | |
Location | getLoc () |
The source location the operation was defined or derived from. More... | |
void | setLoc (Location loc) |
Set the source location the operation was defined or derived from. More... | |
Region * | getParentRegion () |
Returns the region to which the instruction belongs. More... | |
Operation * | getParentOp () |
Returns the closest surrounding operation that contains this operation or nullptr if this is a top-level operation. More... | |
template<typename OpTy > | |
OpTy | getParentOfType () |
Return the closest surrounding parent operation that is of type 'OpTy'. More... | |
template<template< typename T > class Trait> | |
Operation * | getParentWithTrait () |
Returns the closest surrounding parent operation with trait Trait . More... | |
bool | isProperAncestor (Operation *other) |
Return true if this operation is a proper ancestor of the other operation. More... | |
bool | isAncestor (Operation *other) |
Return true if this operation is an ancestor of the other operation. More... | |
void | replaceUsesOfWith (Value from, Value to) |
Replace any uses of 'from' with 'to' within this operation. More... | |
template<typename ValuesT > | |
void | replaceAllUsesWith (ValuesT &&values) |
Replace all uses of results of this operation with the provided 'values'. More... | |
void | destroy () |
Destroys this operation and its subclass data. More... | |
void | dropAllReferences () |
This drops all operand uses from this operation, which is an essential step in breaking cyclic dependences between references when they are to be deleted. More... | |
void | dropAllDefinedValueUses () |
Drop uses of all values defined by this operation or its nested regions. More... | |
void | moveBefore (Operation *existingOp) |
Unlink this operation from its current block and insert it right before existingOp which may be in the same or another block in the same function. More... | |
void | moveBefore (Block *block, llvm::iplist< Operation >::iterator iterator) |
Unlink this operation from its current block and insert it right before iterator in the specified block. More... | |
void | moveAfter (Operation *existingOp) |
Unlink this operation from its current block and insert it right after existingOp which may be in the same or another block in the same function. More... | |
void | moveAfter (Block *block, llvm::iplist< Operation >::iterator iterator) |
Unlink this operation from its current block and insert it right after iterator in the specified block. More... | |
bool | isBeforeInBlock (Operation *other) |
Given an operation 'other' that is within the same parent block, return whether the current operation is before 'other' in the operation list of the parent block. More... | |
void | print (raw_ostream &os, const OpPrintingFlags &flags=llvm::None) |
void | print (raw_ostream &os, AsmState &state) |
void | dump () |
void | setOperands (ValueRange operands) |
Replace the current operands of this operation with the ones provided in 'operands'. More... | |
void | setOperands (unsigned start, unsigned length, ValueRange operands) |
Replace the operands beginning at 'start' and ending at 'start' + 'length' with the ones provided in 'operands'. More... | |
void | insertOperands (unsigned index, ValueRange operands) |
Insert the given operands into the operand list at the given 'index'. More... | |
unsigned | getNumOperands () |
Value | getOperand (unsigned idx) |
void | setOperand (unsigned idx, Value value) |
void | eraseOperand (unsigned idx) |
Erase the operand at position idx . More... | |
void | eraseOperands (unsigned idx, unsigned length=1) |
Erase the operands starting at position idx and ending at position 'idx'+'length'. More... | |
void | eraseOperands (const BitVector &eraseIndices) |
Erases the operands that have their corresponding bit set in eraseIndices and removes them from the operand list. More... | |
operand_iterator | operand_begin () |
operand_iterator | operand_end () |
operand_range | getOperands () |
Returns an iterator on the underlying Value's. More... | |
MutableArrayRef< OpOperand > | getOpOperands () |
OpOperand & | getOpOperand (unsigned idx) |
operand_type_iterator | operand_type_begin () |
operand_type_iterator | operand_type_end () |
operand_type_range | getOperandTypes () |
unsigned | getNumResults () |
Return the number of results held by this operation. More... | |
OpResult | getResult (unsigned idx) |
Get the 'idx'th result of this operation. More... | |
result_iterator | result_begin () |
result_iterator | result_end () |
result_range | getResults () |
result_range | getOpResults () |
OpResult | getOpResult (unsigned idx) |
result_type_iterator | result_type_begin () |
result_type_iterator | result_type_end () |
result_type_range | getResultTypes () |
ArrayRef< NamedAttribute > | getAttrs () |
Return all of the attributes on this operation. More... | |
DictionaryAttr | getAttrDictionary () |
Return all of the attributes on this operation as a DictionaryAttr. More... | |
void | setAttrs (DictionaryAttr newAttrs) |
Set the attribute dictionary on this operation. More... | |
void | setAttrs (ArrayRef< NamedAttribute > newAttrs) |
Attribute | getAttr (StringAttr name) |
Return the specified attribute if present, null otherwise. More... | |
Attribute | getAttr (StringRef name) |
template<typename AttrClass > | |
AttrClass | getAttrOfType (StringAttr name) |
template<typename AttrClass > | |
AttrClass | getAttrOfType (StringRef name) |
bool | hasAttr (StringAttr name) |
Return true if the operation has an attribute with the provided name, false otherwise. More... | |
bool | hasAttr (StringRef name) |
template<typename AttrClass , typename NameT > | |
bool | hasAttrOfType (NameT &&name) |
void | setAttr (StringAttr name, Attribute value) |
If the an attribute exists with the specified name, change it to the new value. More... | |
void | setAttr (StringRef name, Attribute value) |
Attribute | removeAttr (StringAttr name) |
Remove the attribute with the specified name if it exists. More... | |
Attribute | removeAttr (StringRef name) |
dialect_attr_range | getDialectAttrs () |
Return a range corresponding to the dialect attributes for this operation. More... | |
dialect_attr_iterator | dialect_attr_begin () |
dialect_attr_iterator | dialect_attr_end () |
template<typename DialectAttrT > | |
void | setDialectAttrs (DialectAttrT &&dialectAttrs) |
Set the dialect attributes for this operation, and preserve all dependent. More... | |
unsigned | getNumRegions () |
Returns the number of regions held by this operation. More... | |
MutableArrayRef< Region > | getRegions () |
Returns the regions held by this operation. More... | |
Region & | getRegion (unsigned index) |
Returns the region held by this operation at position 'index'. More... | |
MutableArrayRef< BlockOperand > | getBlockOperands () |
succ_iterator | successor_begin () |
succ_iterator | successor_end () |
SuccessorRange | getSuccessors () |
bool | hasSuccessors () |
unsigned | getNumSuccessors () |
Block * | getSuccessor (unsigned index) |
void | setSuccessor (Block *block, unsigned index) |
LogicalResult | fold (ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results) |
Attempt to fold this operation with the specified constant operand values. More... | |
template<template< typename T > class Trait> | |
bool | hasTrait () |
Returns true if the operation was registered with a particular trait, e.g. More... | |
template<template< typename T > class Trait> | |
bool | mightHaveTrait () |
Returns true if the operation might have the provided trait. More... | |
template<WalkOrder Order = WalkOrder::PostOrder, typename FnT , typename RetT = detail::walkResultType<FnT>> | |
std::enable_if< llvm::function_traits< std::decay_t< FnT > >::num_args==1, RetT >::type | walk (FnT &&callback) |
Walk the operation by calling the callback for each nested operation (including this one), block or region, depending on the callback provided. More... | |
template<typename FnT , typename RetT = detail::walkResultType<FnT>> | |
std::enable_if< llvm::function_traits< std::decay_t< FnT > >::num_args==2, RetT >::type | walk (FnT &&callback) |
Generic walker with a stage aware callback. More... | |
void | dropAllUses () |
Drop all uses of results of this operation. More... | |
use_iterator | use_begin () |
use_iterator | use_end () |
use_range | getUses () |
Returns a range of all uses, which is useful for iterating over all uses. More... | |
bool | hasOneUse () |
Returns true if this operation has exactly one use. More... | |
bool | use_empty () |
Returns true if this operation has no uses. More... | |
bool | isUsedOutsideOfBlock (Block *block) |
Returns true if the results of this operation are used outside of the given block. More... | |
user_iterator | user_begin () |
user_iterator | user_end () |
user_range | getUsers () |
Returns a range of all users. More... | |
InFlightDiagnostic | emitOpError (const Twine &message={}) |
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers. More... | |
InFlightDiagnostic | emitError (const Twine &message={}) |
Emit an error about fatal conditions with this operation, reporting up to any diagnostic handlers that may be listening. More... | |
InFlightDiagnostic | emitWarning (const Twine &message={}) |
Emit a warning about this operation, reporting up to any diagnostic handlers that may be listening. More... | |
InFlightDiagnostic | emitRemark (const Twine &message={}) |
Emit a remark about this operation, reporting up to any diagnostic handlers that may be listening. More... | |
Static Public Member Functions | |
static Operation * | create (Location location, OperationName name, TypeRange resultTypes, ValueRange operands, ArrayRef< NamedAttribute > attributes, BlockRange successors, unsigned numRegions) |
Create a new Operation with the specific fields. More... | |
static Operation * | create (Location location, OperationName name, TypeRange resultTypes, ValueRange operands, DictionaryAttr attributes, BlockRange successors, unsigned numRegions) |
Overload of create that takes an existing DictionaryAttr to avoid unnecessarily uniquing a list of attributes. More... | |
static Operation * | create (const OperationState &state) |
Create a new Operation from the fields stored in state . More... | |
static Operation * | create (Location location, OperationName name, TypeRange resultTypes, ValueRange operands, DictionaryAttr attributes, BlockRange successors={}, RegionRange regions={}) |
Create a new Operation with the specific fields. More... | |
Friends | |
struct | llvm::ilist_traits< Operation > |
class | Block |
class | Value |
class | llvm::ilist_node_with_parent< Operation, Block > |
Operation is a basic unit of execution within MLIR.
Operations can be nested within Region
s held by other operations effectively forming a tree. Child operations are organized into operation blocks represented by a 'Block' class.
Definition at line 28 of file Operation.h.
Definition at line 442 of file Operation.h.
using mlir::Operation::operand_iterator = operand_range::iterator |
Definition at line 296 of file Operation.h.
Definition at line 295 of file Operation.h.
Definition at line 317 of file Operation.h.
Definition at line 318 of file Operation.h.
using mlir::Operation::result_iterator = result_range::iterator |
Definition at line 335 of file Operation.h.
Support result iteration.
Definition at line 334 of file Operation.h.
Support result type iteration.
Definition at line 348 of file Operation.h.
Definition at line 349 of file Operation.h.
using mlir::Operation::succ_iterator = SuccessorRange::iterator |
Definition at line 498 of file Operation.h.
Definition at line 614 of file Operation.h.
Definition at line 615 of file Operation.h.
Definition at line 641 of file Operation.h.
Definition at line 642 of file Operation.h.
Operation * Operation::clone | ( | BlockAndValueMapping & | mapper, |
CloneOptions | options = CloneOptions::all() |
||
) |
Create a deep copy of this operation, remapping any operands that use values outside of the operation using the map that is provided (leaving them alone if no entry is present).
Replaces references to cloned sub-operations to the corresponding operation that is copied, and adds those mappings to the map. Optionally, one may configure what parts of the operation to clone using the options parameter.
Calling this method from multiple threads is generally safe if through the process of cloning no new uses of 'Value's from outside the operation are created. Cloning an isolated-from-above operation with no operands, such as top level function operations, is therefore always safe. Using the mapper, it is possible to avoid adding uses to outside operands by remapping them to 'Value's owned by the caller thread.
Replaces references to cloned sub-operations to the corresponding operation that is copied, and adds those mappings to the map.
Definition at line 564 of file Operation.cpp.
References mlir::Region::cloneInto(), create(), getLoc(), getName(), getNumOperands(), getNumRegions(), getNumResults(), getNumSuccessors(), getOperands(), getRegion(), getResult(), getResultTypes(), getSuccessors(), mlir::BlockAndValueMapping::lookupOrDefault(), mlir::BlockAndValueMapping::map(), mlir::Operation::CloneOptions::shouldCloneOperands(), and mlir::Operation::CloneOptions::shouldCloneRegions().
Referenced by clone(), mlir::OpBuilder::clone(), cloneWithoutRegions(), mlir::spirv::Deserializer::collect(), convertToLaunchFuncOp(), fuse(), mlir::linalg::generateLibraryCallName(), mlir::Operation::CloneOptions::shouldCloneOperands(), specializeForLoopForUnrolling(), and specializeParallelLoopForUnrolling().
Operation * Operation::clone | ( | CloneOptions | options = CloneOptions::all() | ) |
Definition at line 598 of file Operation.cpp.
References clone().
Operation * Operation::cloneWithoutRegions | ( | BlockAndValueMapping & | mapper | ) |
Create a partial copy of this operation without traversing into attached regions.
Create a deep copy of this operation but keep the operation regions empty.
The new operation will have the same number of regions as the original one, but they will be left empty. Operands are remapped using mapper
(if present), and mapper
is updated to contain the results.
Operands are remapped using mapper
(if present), and mapper
is updated to contain the results. The mapResults
flag specifies whether the results of the cloned operation should be added to the map.
Definition at line 550 of file Operation.cpp.
References mlir::Operation::CloneOptions::all(), clone(), and mlir::Operation::CloneOptions::cloneRegions().
Referenced by mlir::OpBuilder::cloneWithoutRegions().
Operation * Operation::cloneWithoutRegions | ( | ) |
Create a partial copy of this operation without traversing into attached regions.
The new operation will have the same number of regions as the original one, but they will be left empty.
Definition at line 554 of file Operation.cpp.
Referenced by mlir::Operation::CloneOptions::shouldCloneOperands().
|
static |
Create a new Operation with the specific fields.
Definition at line 27 of file Operation.cpp.
References mlir::Location::getContext().
Referenced by checkAndNestUnderRewriteOp(), clone(), mlir::spirv::Deserializer::collect(), create(), mlir::OperationFolder::create(), mlir::OpBuilder::create(), mlir::OpBuilder::createOrFold(), createParallelComputeFunction(), getLLVMAtomicOrdering(), hasAllocationScope(), isDefinedByCallTo(), mlirOperationCreate(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), and setupCoroMachinery().
|
static |
Overload of create that takes an existing DictionaryAttr to avoid unnecessarily uniquing a list of attributes.
Definition at line 59 of file Operation.cpp.
References mlir::InFlightDiagnostic::attachNote(), diag(), emitOpError(), getBlockOperands(), getContext(), getDialect(), getRegion(), getRegions(), mlir::OperationName::getStringRef(), getUsers(), mlir::OperationName::hasTrait(), mightHaveTrait(), use_empty(), and mlir::detail::OperandStorage::~OperandStorage().
|
static |
Create a new Operation from the fields stored in state
.
Create a new Operation from operation state.
Definition at line 37 of file Operation.cpp.
References mlir::OperationState::attributes, create(), mlir::OperationState::getContext(), mlir::NamedAttrList::getDictionary(), mlir::OperationState::location, mlir::OperationState::name, mlir::OperationState::operands, mlir::OperationState::regions, mlir::OperationState::successors, and mlir::OperationState::types.
|
static |
Create a new Operation with the specific fields.
Definition at line 44 of file Operation.cpp.
References create(), getRegion(), and mlir::Region::takeBody().
void Operation::destroy | ( | ) |
Destroys this operation and its subclass data.
Destroy this operation or one of its subclasses.
Definition at line 171 of file Operation.cpp.
Referenced by mlir::OperationFolder::create(), mlir::OpBuilder::createOrFold(), llvm::ilist_traits<::mlir::Operation >::deleteNode(), erase(), and replaceAllUsesWith().
|
inline |
Definition at line 450 of file Operation.h.
References getAttrs().
|
inline |
Definition at line 454 of file Operation.h.
References getAttrs().
void Operation::dropAllDefinedValueUses | ( | ) |
Drop uses of all values defined by this operation or its nested regions.
This drops all uses of any values defined by this operation or its nested regions, wherever they are located.
Definition at line 482 of file Operation.cpp.
References mlir::Block::dropAllDefinedValueUses(), dropAllUses(), and getRegions().
Referenced by replaceAllUsesWith().
void Operation::dropAllReferences | ( | ) |
This drops all operand uses from this operation, which is an essential step in breaking cyclic dependences between references when they are to be deleted.
Definition at line 469 of file Operation.cpp.
References getBlockOperands(), getOpOperands(), and getRegions().
Referenced by mlir::Block::dropAllReferences(), and replaceAllUsesWith().
|
inline |
Drop all uses of results of this operation.
Definition at line 609 of file Operation.h.
References getOpResults().
Referenced by detachNestedAndErase(), and dropAllDefinedValueUses().
void Operation::dump | ( | ) |
Definition at line 3147 of file AsmPrinter.cpp.
References print().
Referenced by mlir::checkMemrefAccessDependence(), checkTilingLegalityImpl(), logSucessfulPatternApplication(), and replaceAllUsesWith().
InFlightDiagnostic Operation::emitError | ( | const Twine & | message = {} | ) |
Emit an error about fatal conditions with this operation, reporting up to any diagnostic handlers that may be listening.
Definition at line 231 of file Operation.cpp.
References mlir::Diagnostic::append(), mlir::Diagnostic::appendOp(), mlir::InFlightDiagnostic::attachNote(), diag(), mlir::emitError(), getContext(), and getLoc().
Referenced by addNamedOpBuilders(), mlir::affineDataCopyGenerate(), applyTilingToAll(), assertDestinationPassingStyle(), mlir::bufferization::bufferizeOp(), checkAffineLoopNestMappableImpl(), checkAliasInfoConsistency(), checkAndUpdateCapabilityRequirements(), checkAndUpdateExtensionRequirements(), mlir::MemRefRegion::compute(), computeMemRefRankReductionMask(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertOmpThreadprivate(), convertStandaloneDataOp(), convertStructType(), mlir::convertVectorToNVVMCompatibleMMASync(), mlir::LLVM::detail::createIntrinsicCall(), mlir::bufferization::deallocateBuffers(), diagnoseInvalidOperandDominance(), eachHasOnlyOneOfTypes(), emitOpError(), findLiveUserOfReplaced(), generateLocationsFromIR(), getEnclosingforOps(), mlir::transform::TransformState::getHandleForPayloadOp(), getInsertExtractValueElementType(), getMemoryFootprintBytes(), getOrInsertBuiltinVariable(), mlir::spirv::getPushConstantValue(), getUsers(), mlir::nvgpu::getWarpMatrixInfo(), hasOneBranchOpTo(), mlir::insertBackwardComputationSlice(), isZeroAttribute(), legalizeUnresolvedMaterialization(), mlir::linalg::LinalgBasePromotionPattern::matchAndRewrite(), mayBeValidWithoutTerminator(), mlir::DataLayoutSpecAttr::print(), print(), printOperation(), validateSupportedControlFlow(), mlir::detail::verifyBranchSuccessorOperands(), mlir::OpTrait::impl::verifyCompatibleOperandBroadcast(), mlir::detail::verifyDataLayoutOp(), verifyFuncOpInterfaceStructAttr(), mlir::verifyListOfOperandsOrIntegers(), verifyMemorySemantics(), verifyNumBlockArgs(), verifyPointerAndCoopMatrixType(), verifyRegionAttribute(), verifyShiftOp(), mlir::detail::verifySymbolTable(), verifyTerminatorSuccessors(), and walkReferenceCountedValues().
InFlightDiagnostic Operation::emitOpError | ( | const Twine & | message = {} | ) |
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers.
Definition at line 518 of file Operation.cpp.
References emitError(), and getName().
Referenced by mlir::spirv::Deserializer::collect(), create(), foldTransferInBoundsAttribute(), getInsertExtractValueElementType(), mlir::OpPassManager::getNesting(), getUsers(), inlineCallsInSCC(), mlir::scf::insideMutuallyExclusiveBranches(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), printOperation(), processOperands(), mlir::OpTrait::impl::verifyAtLeastNOperands(), mlir::OpTrait::impl::verifyAtLeastNRegions(), mlir::OpTrait::impl::verifyAtLeastNResults(), mlir::OpTrait::impl::verifyAtLeastNSuccessors(), verifyAtomicUpdateOp(), verifyAttributions(), mlir::impl::verifyCastInterfaceOp(), verifyCastOp(), verifyCollapsedShape(), mlir::OpTrait::impl::verifyCompatibleOperandBroadcast(), mlir::OpTrait::impl::verifyElementwise(), verifyGroupNonUniformArithmeticOp(), verifyHasBindingUse(), mlir::detail::verifyInferredResultTypes(), mlir::OpTrait::impl::verifyIsTerminator(), verifyMemoryOpIndexing(), verifyMultShape(), mlir::OpTrait::impl::verifyNOperands(), mlir::OpTrait::impl::verifyNoRegionArguments(), mlir::OpTrait::impl::verifyNRegions(), mlir::OpTrait::impl::verifyNResults(), mlir::OpTrait::impl::verifyNSuccessors(), mlir::OpTrait::impl::verifyOneOperand(), mlir::OpTrait::impl::verifyOneRegion(), mlir::OpTrait::impl::verifyOneResult(), mlir::OpTrait::impl::verifyOneSuccessor(), verifyOpaquePtr(), mlir::OpTrait::impl::verifyOperandsAreFloatLike(), mlir::OpTrait::impl::verifyOperandsAreSignlessIntegerLike(), verifyOpMetadata(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), verifyReductionVarList(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait(), mlir::OpTrait::impl::verifyResultsAreBoolLike(), mlir::OpTrait::impl::verifyResultsAreFloatLike(), mlir::OpTrait::impl::verifyResultsAreSignlessIntegerLike(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), mlir::OpTrait::impl::verifySameOperandsAndResultShape(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), mlir::OpTrait::impl::verifySameOperandsElementType(), mlir::OpTrait::impl::verifySameOperandsShape(), mlir::OpTrait::impl::verifySameTypeOperands(), verifyShapeOrExtentTensorOp(), verifySizeOrIndexOp(), mlir::linalg::detail::verifyStructuredOpInterface(), mlir::detail::verifySymbol(), verifySymbolAttribute(), verifySymbolAttrUse(), mlir::detail::verifySymbolTable(), verifySynchronizationHint(), verifyTileSize(), mlir::OpTrait::SingleBlock< ConcreteType >::verifyTrait(), mlir::OpTrait::HasParent< ParentOpTypes >::Impl< ConcreteType >::verifyTrait(), verifyTypesAlongAllEdges(), mlir::OpTrait::impl::verifyValueSizeAttr(), verifyVectorMemoryOp(), mlir::OpTrait::impl::verifyZeroOperands(), mlir::OpTrait::impl::verifyZeroRegions(), mlir::OpTrait::impl::verifyZeroResults(), mlir::OpTrait::impl::verifyZeroSuccessors(), and walkReferenceCountedValues().
InFlightDiagnostic Operation::emitRemark | ( | const Twine & | message = {} | ) |
Emit a remark about this operation, reporting up to any diagnostic handlers that may be listening.
Definition at line 252 of file Operation.cpp.
References mlir::InFlightDiagnostic::attachNote(), diag(), mlir::emitRemark(), getContext(), and getLoc().
Referenced by emitRemarkForBlock(), and getUsers().
InFlightDiagnostic Operation::emitWarning | ( | const Twine & | message = {} | ) |
Emit a warning about this operation, reporting up to any diagnostic handlers that may be listening.
Definition at line 243 of file Operation.cpp.
References mlir::InFlightDiagnostic::attachNote(), diag(), mlir::emitWarning(), getContext(), and getLoc().
Referenced by getLibraryCallSymbolRef(), getMemoryFootprintBytes(), and getUsers().
void Operation::erase | ( | ) |
Remove this operation from its parent block and delete it.
Remove this operation (and its descendants) from its Block and delete all of them.
Definition at line 424 of file Operation.cpp.
References destroy(), and getBlock().
Referenced by mlir::affineScalarReplace(), mlir::applyPatternsAndFoldGreedily(), mlir::collapseParallelLoops(), mlir::spirv::Deserializer::collect(), collectCallOps(), containsReturn(), convertTransferWriteOp(), convertYieldOp(), createMask(), detachNestedAndErase(), mlir::SymbolTable::erase(), mlir::RewriterBase::eraseOp(), findAncestorOpInRegion(), fuseIfLegal(), hasAllocationScope(), mlir::OperationFolder::insertKnownConstant(), isFusionProfitable(), isMemRefNormalizable(), isRegistered(), mlir::normalizeMemRef(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), outlineKernelFuncImpl(), mlir::replaceAllMemRefUsesWith(), replaceForOpWithNewSignature(), mlir::replaceForOpWithNewYields(), mlir::RewriterBase::replaceOp(), sourceMaterializationCallback(), specializeForLoopForUnrolling(), specializeParallelLoopForUnrolling(), mlir::OpBuilder::tryFold(), mlir::OperationFolder::tryToFold(), updateCalls(), updateReturnOps(), and mlir::detail::RecoveryReproducerContext::~RecoveryReproducerContext().
Erase the operand at position idx
.
Definition at line 280 of file Operation.h.
References eraseOperands().
Erase the operands starting at position idx
and ending at position 'idx'+'length'.
Definition at line 284 of file Operation.h.
Referenced by mlir::MutableOperandRange::clear(), mlir::MutableOperandRange::erase(), and eraseOperand().
|
inline |
Erases the operands that have their corresponding bit set in eraseIndices
and removes them from the operand list.
Definition at line 290 of file Operation.h.
LogicalResult Operation::fold | ( | ArrayRef< Attribute > | operands, |
SmallVectorImpl< OpFoldResult > & | results | ||
) |
Attempt to fold this operation with the specified constant operand values.
Attempt to fold this operation using the Op's registered foldHook.
results
vector. If not, results
is unspecified. Definition at line 496 of file Operation.cpp.
References mlir::failure(), getDialect(), getRegisteredInfo(), mlir::succeeded(), and mlir::success().
Referenced by mlir::OperationFolder::getOrCreateConstant(), getSuccessor(), mlir::detail::constant_op_binder< AttrT >::match(), and mlir::OpBuilder::tryFold().
|
inline |
Return the specified attribute if present, null otherwise.
Definition at line 378 of file Operation.h.
Referenced by createConstFromIntAttribute(), createDepthwiseConvCollapseMap(), createLinalgBodyCalculationForElementwiseOp(), mlir::LLVM::detail::DebugTranslation::DebugTranslation(), getAssumedUniqueReturnOp(), getAttrOfType(), mlir::linalg::LinalgTransformationFilter::hasReplacementFilter(), lookupSymbolInImpl(), prepareLLVMModule(), setInPlaceOpOperand(), setLoopMetadata(), mlir::detail::verifySymbol(), and verifySymbolAttribute().
|
inline |
Definition at line 379 of file Operation.h.
|
inline |
Return all of the attributes on this operation as a DictionaryAttr.
Definition at line 366 of file Operation.h.
Referenced by mlir::OperationEquivalence::computeHash(), mlir::OperationEquivalence::isEquivalentTo(), logFailure(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), replaceAllSymbolUsesImpl(), mlir::detail::verifyInferredResultTypes(), and walkSymbolRefs().
|
inline |
Definition at line 382 of file Operation.h.
References mlir::Attribute::dyn_cast_or_null(), and getAttr().
Referenced by convertOperationImpl(), mlir::function_interface_impl::eraseFunctionArguments(), mlir::function_interface_impl::eraseFunctionResults(), executeGetOperandsResults(), findDuplicateElement(), mlir::function_interface_impl::getArgAttrDict(), mlir::impl::getDataLayoutSpec(), getNameIfSymbol(), mlir::function_interface_impl::getResultAttrDict(), mlir::SymbolTable::getSymbolVisibility(), mlir::function_interface_impl::insertFunctionArguments(), mlir::function_interface_impl::insertFunctionResults(), mlir::spirv::lookupEntryPointABI(), mlir::spirv::lookupTargetEnv(), printAtomicUpdateOp(), mlir::function_interface_impl::printFunctionSignature(), printGroupNonUniformArithmeticOp(), printIR(), printVariableDecorations(), mlir::LLVM::ModuleTranslation::setAccessGroupsMetadata(), mlir::LLVM::ModuleTranslation::setAliasScopeMetadata(), mlir::function_interface_impl::detail::setArgResAttrDict(), mlir::function_interface_impl::setFunctionType(), verifyAtomicUpdateOp(), verifyGroupNonUniformArithmeticOp(), mlir::detail::verifySymbol(), mlir::detail::verifySymbolTable(), and mlir::OpTrait::impl::verifyValueSizeAttr().
|
inline |
Definition at line 386 of file Operation.h.
References mlir::Attribute::dyn_cast_or_null(), and getAttr().
|
inline |
Return all of the attributes on this operation.
Definition at line 363 of file Operation.h.
Referenced by cloneOpWithOperandsAndTypes(), mlir::createSimplifyAffineStructuresPass(), dialect_attr_begin(), dialect_attr_end(), getDialectAttrs(), isMemRefNormalizable(), mayBeValidWithoutTerminator(), mlirLinalgFillBuiltinNamedOpRegion(), mlir::LLVM::detail::oneToOneRewrite(), mlir::function_interface_impl::printFunctionAttributes(), mlir::AsmPrinter::Impl::printIntegerSet(), printNamedStructuredOp(), printOneResultOp(), printOperation(), printVariableDecorations(), reduceIfNeeded(), mlir::replaceAllMemRefUsesWith(), setDialectAttrs(), mlir::DataDescriptor::setSize(), shouldPrintElementsAttrWithHex(), splatZero(), vectorizeOneOp(), mlir::LLVM::detail::vectorOneToOneRewrite(), and widenOp().
|
inline |
Returns the operation block that contains this operation.
Definition at line 151 of file Operation.h.
Referenced by llvm::ilist_traits<::mlir::Operation >::addNodeToList(), mlir::detail::ConversionPatternRewriterImpl::applyRewrites(), constructTiledLoopNest(), mlir::createLoopFusionPass(), diagnoseInvalidOperandDominance(), erase(), mlir::Region::findAncestorBlockInRegion(), findAncestorOpInRegion(), findInstPosition(), mlir::bufferization::foldToMemrefToTensorPair(), funcsToCoroutines(), mlir::generateCopyForMemRegion(), getCommonBlock(), getEnclosingforOps(), getPhiIncomingBlock(), mlir::bufferization::BufferPlacementAllocs::getStartOperation(), hasAllocationScope(), hasNoInterveningEffect(), hoistAffineIfOp(), mlir::inlineRegion(), mlir::OperationFolder::insertKnownConstant(), mlir::Liveness::isDeadAfter(), mlir::isLegalForBranchOpInterfaceTypeConversionPattern(), mlir::isNotBranchOpInterfaceOrReturnLikeOp(), mlir::detail::DominanceInfoBase< true >::isReachableFromEntry(), mlir::Value::isUsedOutsideOfBlock(), lastNonTerminatorInRegion(), mlir::linalg::LinalgBaseTileAndFusePattern::matchAndRewrite(), mlir::linalg::PadOpTransformationPattern::matchAndRewrite(), mayExistInterleavedUses(), mlir::RewriterBase::mergeBlockBefore(), moveAfter(), moveBefore(), mlir::OperationFolder::notifyRemoval(), printIR(), mlir::DominanceInfo::properlyDominates(), mlir::PostDominanceInfo::properlyPostDominates(), remove(), mlir::OpBuilder::setInsertionPoint(), mlir::OpBuilder::setInsertionPointAfter(), mlir::Block::splitBlock(), mlir::OperationFolder::tryToFold(), validateSupportedControlFlow(), mlir::OpTrait::impl::verifyIsTerminator(), and verifyResultTypesAreInferrable().
|
inline |
Definition at line 493 of file Operation.h.
Referenced by mlir::spirv::Deserializer::collect(), create(), dropAllReferences(), mlir::BlockOperand::getOperandNumber(), getSuccessor(), setSuccessor(), and mlir::SuccessorRange::SuccessorRange().
|
inline |
Return the context this operation is associated with.
Definition at line 154 of file Operation.h.
References mlir::Attribute::getContext().
Referenced by mlir::gpu::addAsyncDependency(), annotateConflict(), mlir::applyOpPatternsAndFold(), mlir::bufferization::func_ext::FuncOpInterface::bufferize(), mlir::bufferization::bufferizeOp(), collectValidReferencesFor(), create(), mlir::bufferization::createAllocDeallocOps(), diagnoseInvalidOperandDominance(), emitError(), emitRemark(), emitWarning(), generateLocationsFromIR(), getAssumedUniqueReturnOp(), mlir::getComputationSliceState(), mlir::Region::getContext(), getIdentity(), getLibraryCallSymbolRef(), mlir::LLVM::detail::getLLVMConstant(), getLocalInvocationDimSize(), mlir::OpPassManager::getNesting(), mlir::detail::PassCrashReproducerGenerator::initialize(), mlir::SymbolTable::insert(), mlir::bufferization::insertSliceAnchoredAllocTensorEliminationStep(), mlir::SymbolTable::lookup(), mlir::SymbolTable::lookupSymbolIn(), mlir::spirv::lookupTargetEnvOrDefault(), matchAndReplaceDepthwiseConv(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), mlirLinalgFillBuiltinNamedOpRegion(), mlir::linalg::populateElementwiseOpsFusionPatterns(), mlir::linalg::populateFoldUnitExtentDimsPatterns(), prepareLLVMModule(), removeAttr(), mlir::detail::OpToOpPassAdaptor::runOnOperation(), mlir::function_interface_impl::setAllArgAttrDicts(), setAllArgResAttrDicts(), mlir::function_interface_impl::setAllResultAttrDicts(), mlir::function_interface_impl::detail::setArgResAttrDict(), setAttr(), setAttrs(), setDialectAttrs(), mlir::SymbolTable::setSymbolName(), mlir::SymbolTable::setSymbolVisibility(), mlir::SymbolTable::SymbolTable(), mlir::detail::verifyInferredResultTypes(), verifyOpAndAdjustFlags(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), and GpuAsyncRegionPass::DeferWaitCallback::~DeferWaitCallback().
|
inline |
Return the dialect this operation is associated with, or nullptr if the associated dialect is not loaded.
Definition at line 158 of file Operation.h.
References mlir::OperationName::getDialect(), and getName().
Referenced by create(), fold(), funcsToCoroutines(), mlir::detail::DialectInterfaceCollectionBase::getInterfaceFor(), mlir::Dialect::getOperationPrinter(), mlir::OperationFolder::getOrCreateConstant(), mlir::OperationFolder::insertKnownConstant(), mlir::bufferization::BufferizationOptions::isOpAllowed(), isPotentiallyUnknownSymbolTable(), lowerEntryPointABIAttr(), mlir::OpState::print(), mlir::AsmPrinter::Impl::printIntegerSet(), mlir::OpBuilder::tryFold(), and verifyResultTypesAreInferrable().
|
inline |
Return a range corresponding to the dialect attributes for this operation.
Definition at line 445 of file Operation.h.
References getAttrs().
Referenced by forwardPassthroughAttributes().
|
inline |
The source location the operation was defined or derived from.
Definition at line 161 of file Operation.h.
Referenced by addRuntimePreemptionSpecifier(), mlir::affineDataCopyGenerate(), buildMultiDimReduce(), buildUnresolvedTargetMaterialization(), buildVectorComparison(), canonicalizeMinMaxOp(), checkDoubleConsume(), clone(), collapseGenericOpIterationDims(), computeMemoryOpIndices(), containsReturn(), mlir::LLVM::ModuleTranslation::convertBlock(), convertElementwiseOp(), mlir::createAffineComputationSlice(), mlir::AllocLikeOpLLVMLowering::createAligned(), createConstFromIntAttribute(), createLinalgBodyCalculationForElementwiseOp(), createLinalgBodyCalculationForReduceOp(), createPrivateMemRef(), createSourceLocationInfo(), diagnoseInvalidOperandDominance(), mlir::vector::distributPointwiseVectorOp(), elementwiseMatchAndRewriteHelper(), emitError(), emitRemark(), emitWarning(), mlir::detail::PassCrashReproducerGenerator::finalize(), findLiveUserOfReplaced(), fuse(), getBlockIt(), mlir::bufferization::BufferizationState::getBuffer(), getLibraryCallSymbolRef(), mlir::Region::getLoc(), getMemoryFootprintBytes(), mlir::getMemRefSizeInBytes(), getOrCreateOperandsMatchingResultTypes(), getOrInsertBuiltinVariable(), mlir::scf::getParallelForInductionVarOwner(), mlir::spirv::getPushConstantValue(), mlir::LLVM::detail::handleMultidimensionalVectors(), insertCasts(), interruptIfValidLocation(), mlir::OperationEquivalence::isEquivalentTo(), isFusionProfitable(), isMemRefNormalizable(), logFailure(), matchAndReplaceDepthwiseConv(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), mlir::ConversionPattern::matchAndRewrite(), mlir::linalg::LinalgBaseTileAndFusePattern::matchAndRewrite(), mlirLinalgFillBuiltinNamedOpRegion(), mlir::RewriterBase::notifyMatchFailure(), mlir::LLVM::detail::oneToOneRewrite(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), prepareLLVMModule(), printConstantOp(), mlir::AsmPrinter::Impl::printIntegerSet(), printOperation(), reduceIfNeeded(), reduceMatchAndRewriteHelper(), ReifyExpandOrCollapseShapeOp< OpTy >::reifyResultShapes(), mlir::replaceAllMemRefUsesWith(), mlir::bufferization::replaceOpWithNewBufferizedOp(), mlir::RewriterBase::replaceOpWithNewOp(), shouldPrintElementsAttrWithHex(), splatZero(), mlir::vector::splitFullAndPartialTransfer(), mlir::OpBuilder::tryFold(), vectorizeOneOp(), mlir::LLVM::detail::vectorOneToOneRewrite(), verifyCoopMatrixMulAdd(), mlir::detail::verifyDataLayoutOp(), mlir::detail::verifyInferredResultTypes(), mlir::OpTrait::impl::verifyIsIsolatedFromAbove(), verifyRegionAttribute(), verifyResultTypesAreInferrable(), mlir::detail::verifySymbolTable(), widenOp(), and GpuAsyncRegionPass::DeferWaitCallback::~DeferWaitCallback().
|
inline |
The name of an operation is the key identifier for it.
Definition at line 57 of file Operation.h.
Referenced by mlir::linalg::LinalgTransformationFilter::addOpNameFilter(), checkAndUpdateCapabilityRequirements(), checkAndUpdateExtensionRequirements(), mlir::Op< AffineDmaStartOp, OpTrait::MemRefsNormalizable, OpTrait::VariadicOperands, OpTrait::ZeroResults, OpTrait::OpInvariants, AffineMapAccessInterface::Trait >::classof(), clone(), cloneOpWithOperandsAndTypes(), mlir::OperationEquivalence::computeHash(), convertOmpThreadprivate(), convertStandaloneDataOp(), mlir::LLVM::detail::createIntrinsicCall(), mlir::createSimplifyAffineStructuresPass(), emitOpError(), mlir::ConversionPatternRewriter::eraseOp(), findLiveUserOfReplaced(), mlir::OpTrait::impl::foldIdempotent(), mlir::OpTrait::impl::foldInvolution(), mlir::linalg::generateLibraryCallName(), mlir::SPIRVConversionTarget::get(), getDialect(), getElementPtrType(), mlir::OpInterface< AffineMapAccessInterface, detail::AffineMapAccessInterfaceInterfaceTraits >::getInterfaceFor(), getLspDiagnoticFromDiag(), getRegisteredInfo(), mlir::AsmParserState::initialize(), inlineCallsInSCC(), mlir::OperationEquivalence::isEquivalentTo(), mlir::ConversionTarget::isIllegal(), mlir::ConversionTarget::isLegal(), isMemRefNormalizable(), isRegistered(), legalizeUnresolvedMaterialization(), mlir::PatternApplicator::matchAndRewrite(), mlir::ConversionPattern::matchAndRewrite(), mayBeValidWithoutTerminator(), mlirLinalgFillBuiltinNamedOpRegion(), mlir::ConversionPatternRewriter::notifyOperationInserted(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), mlir::detail::PassCrashReproducerGenerator::prepareReproducerFor(), mlir::CallGraph::print(), mlir::AsmPrinter::Impl::printIntegerSet(), printIR(), mlir::OpState::printOpName(), mlir::spirv::Serializer::printValueIDMap(), reduceIfNeeded(), mlir::replaceAllMemRefUsesWith(), mlir::ConversionPatternRewriter::replaceOp(), mlir::ConversionPatternRewriter::replaceUsesOfBlockArgument(), mlir::PassManager::run(), mlir::detail::OpToOpPassAdaptor::runOnOperation(), splatZero(), vectorizeOneOp(), verifyOpAndAdjustFlags(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait(), visitInPrettyBlockOrder(), and widenOp().
|
inline |
Definition at line 270 of file Operation.h.
Referenced by addExecuteResults(), clone(), mlir::Region::cloneInto(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertOmpOpRegions(), convertStandaloneDataOp(), mlir::createAffineComputationSlice(), elementwiseMatchAndRewriteHelper(), executeGetOperandsResults(), extractOperandTypes(), mlir::OpTrait::impl::foldIdempotent(), foldMemRefCast(), getAssumedUniqueReturnOp(), mlir::OperationFolder::getOrCreateConstant(), mlir::scf::insideMutuallyExclusiveBranches(), isAddMul(), isChainOfUnaryOpsFrom(), mlir::detail::isConstantLike(), mlir::OperationEquivalence::isEquivalentTo(), isOpLoopInvariant(), mlir::lowerAffineLowerBound(), mlir::transform::detail::mapPossibleTopLevelTransformOpBlockArguments(), mlir::detail::RecursivePatternMatcher< OpType, OperandMatchers >::match(), mlir::matchReduction(), materializeConversion(), mlir::MutableOperandRange::MutableOperandRange(), printGroupNonUniformArithmeticOp(), mlir::AsmPrinter::Impl::printIntegerSet(), printOperation(), mlir::replaceAllMemRefUsesWith(), setInPlaceOpOperand(), setOperands(), mlir::OpBuilder::tryFold(), vectorizeAffineYieldOp(), mlir::OpTrait::impl::verifyAtLeastNOperands(), verifyAtomicUpdateOp(), verifyGroupNonUniformArithmeticOp(), mlir::OpTrait::impl::verifyNOperands(), mlir::OpTrait::impl::verifyOneOperand(), mlir::OpTrait::impl::verifyOperandSizeAttr(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), mlir::OpTrait::impl::verifySameTypeOperands(), verifyTypesAlongAllEdges(), and mlir::OpTrait::impl::verifyZeroOperands().
|
inline |
Returns the number of regions held by this operation.
Definition at line 475 of file Operation.h.
Referenced by clone(), mlir::createLoopFusionPass(), diagnoseInvalidOperandDominance(), findOptimal(), getBackwardSliceImpl(), getLspDiagnoticFromDiag(), mlir::OperationEquivalence::isEquivalentTo(), isPotentiallyUnknownSymbolTable(), isVectorizableLoopBodyWithOpCond(), mlir::detail::ConversionPatternRewriterImpl::markNestedOpsIgnored(), mlir::ConversionPattern::matchAndRewrite(), mayBeValidWithoutTerminator(), mlirLinalgFillBuiltinNamedOpRegion(), mlirOperationGetFirstRegion(), mlirRegionGetNextInOperation(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), mlir::AsmPrinter::Impl::printIntegerSet(), processParallelLoop(), shouldPrintElementsAttrWithHex(), mlir::vector::splitFullAndPartialTransfer(), mlir::SymbolTable::SymbolTable(), vectorizeOneOperation(), mlir::OpTrait::impl::verifyAtLeastNRegions(), mlir::OpTrait::impl::verifyNoRegionArguments(), mlir::OpTrait::impl::verifyNRegions(), mlir::OpTrait::impl::verifyOneRegion(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait(), mlir::detail::verifySymbolTable(), mlir::OpTrait::SingleBlock< ConcreteType >::verifyTrait(), mlir::detail::verifyTypesAlongControlFlowEdges(), and mlir::OpTrait::impl::verifyZeroRegions().
|
inline |
Return the number of results held by this operation.
Definition at line 328 of file Operation.h.
Referenced by analyzeProfitability(), clone(), convertOperationImpl(), mlir::vector::distributPointwiseVectorOp(), elementwiseMatchAndRewriteHelper(), mlir::ConversionPatternRewriter::eraseOp(), executeGetOperandsResults(), mlir::linalg::generateLibraryCallName(), getEnclosingforOps(), getLibraryCallSymbolRef(), mlir::OperationFolder::getOrCreateConstant(), getUsers(), mlir::detail::isConstantLike(), mlir::OperationEquivalence::isEquivalentTo(), isMemRefNormalizable(), VectorizeConvolution::matchAndRewrite(), mlir::matchReduction(), materializeConversion(), mlir::detail::ConversionPatternRewriterImpl::notifyOpReplaced(), mlir::LLVM::detail::oneToOneRewrite(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), mlir::Liveness::print(), mlir::OpAsmPrinter::printFunctionalType(), mlir::AsmPrinter::Impl::printIntegerSet(), printNVVMIntrinsicOp(), printOneResultOp(), printOperation(), mlir::replaceAllMemRefUsesWith(), mlir::RewriterBase::replaceOp(), mlir::bufferization::replaceOpWithBufferizedValues(), mlir::RewriterBase::replaceOpWithIf(), splatZero(), mlir::RewriterBase::splitBlock(), mlir::OpTrait::impl::verifyAtLeastNResults(), mlir::OpTrait::impl::verifyElementwise(), mlir::OpTrait::impl::verifyNResults(), mlir::OpTrait::impl::verifyOneResult(), mlir::OpTrait::impl::verifyResultSizeAttr(), verifyShapeOrExtentTensorOp(), verifySizeOrIndexOp(), mlir::linalg::detail::verifyStructuredOpInterface(), mlir::OpTrait::impl::verifyZeroResults(), and walkReferenceCountedValues().
|
inline |
Definition at line 504 of file Operation.h.
Referenced by clone(), collectUnderlyingAddressValues(), eraseTerminatorSuccessorOperands(), mlir::Block::getNumSuccessors(), getPHISourceValue(), getSuccessor(), mlir::OperationEquivalence::isEquivalentTo(), mayBeValidWithoutTerminator(), mlir::AsmPrinter::Impl::printIntegerSet(), propagateTerminatorLiveness(), setSuccessor(), mlir::SuccessorRange::SuccessorRange(), mlir::OpTrait::impl::verifyAtLeastNSuccessors(), mlir::OpTrait::impl::verifyNSuccessors(), mlir::OpTrait::impl::verifyOneSuccessor(), and mlir::OpTrait::impl::verifyZeroSuccessors().
Definition at line 274 of file Operation.h.
References mlir::IROperand< DerivedT, IRValueT >::get(), and getOpOperand().
Referenced by adjustAccessChainForBitwidth(), mlir::affineParallelize(), mlir::sparse_tensor::Merger::buildTensorExpFromLinalg(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertOmpOpRegions(), createLinalgBodyCalculationForElementwiseOp(), diagnoseInvalidOperandDominance(), foldExtractFromBroadcast(), foldExtractStridedOpFromInsertChain(), mlir::OpTrait::impl::foldIdempotent(), mlir::OpTrait::impl::foldInvolution(), getLocalInvocationDimSize(), mlir::OperationFolder::getOrCreateConstant(), getPHISourceValue(), isChainOfUnaryOpsFrom(), isOpLoopInvariant(), isSumOfMul(), linalgOpToLoopsImpl(), mlir::lowerAffineLowerBound(), mlir::transform::detail::mapPossibleTopLevelTransformOpBlockArguments(), mlir::detail::matchOperandOrValueAtIndex(), mlir::matchReduction(), materializeConversion(), printAtomicUpdateOp(), printGroupNonUniformArithmeticOp(), printOperation(), reduceMatchAndRewriteHelper(), mlir::OpBuilder::tryFold(), validateSupportedControlFlow(), verifyAtomicUpdateOp(), verifyCastOp(), verifyGroupNonUniformArithmeticOp(), mlir::OpTrait::impl::verifySameOperandsElementType(), mlir::OpTrait::impl::verifySameTypeOperands(), and verifyShiftOp().
|
inline |
Returns an iterator on the underlying Value's.
Definition at line 302 of file Operation.h.
References getOpOperands().
Referenced by clone(), mlir::Region::cloneInto(), mlir::OperationEquivalence::computeHash(), convertElementwiseOp(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertStructType(), mlir::createAffineComputationSlice(), defaultIsSmallAlloc(), dependsOnCarriedVals(), diagnoseInvalidOperandDominance(), eachHasOnlyOneOfTypes(), elementwiseMatchAndRewriteHelper(), extractBeneficiaryOps(), mlir::impl::foldCastInterfaceOp(), getBackwardSliceImpl(), getOperandTypes(), getOrCreateOperandsMatchingResultTypes(), getOutermostInvariantForOp(), mlir::scf::getParallelForInductionVarOwner(), mlir::linalg::getUpperBoundForIndex(), mlir::LLVM::detail::handleMultidimensionalVectors(), hasAllocationScope(), hasNonAffineUsersOnThePath(), inlineConvertOmpRegions(), insertCasts(), mlir::OperationEquivalence::isEquivalentTo(), isMemRefNormalizable(), AllocaScopeInliner::matchAndRewrite(), mlir::ConversionPattern::matchAndRewrite(), AllocaScopeHoister::matchAndRewrite(), matchSimpleReduction(), mayBeValidWithoutTerminator(), operand_begin(), operand_end(), mlir::MutableOperandRange::operator OperandRange(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), mlir::outlineSingleBlockRegion(), printAtomicUpdateOp(), mlir::OpAsmPrinter::printFunctionalType(), mlir::AsmPrinter::Impl::printIntegerSet(), printNVVMIntrinsicOp(), printOneResultOp(), printOperation(), mlir::replaceAllMemRefUsesWith(), mlir::replaceForOpWithNewYields(), replaceOpWithRegion(), mlir::sortTopologically(), sourceMaterializationCallback(), splatZero(), vectorizeOneOp(), verifyCoopMatrixMulAdd(), mlir::detail::verifyInferredResultTypes(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), mlir::OpTrait::impl::verifySameOperandsElementType(), visitInPrettyBlockOrder(), and widenOp().
|
inline |
Definition at line 321 of file Operation.h.
References getOperands(), and mlir::OperandRange::getTypes().
Referenced by extractOperandTypes(), mlir::linalg::generateLibraryCallName(), getOpToConvert(), hasTensorSemantics(), insertCasts(), isElementwiseMappableOpOnRankedTensors(), mlir::TypeConverter::isLegal(), mlir::outlineSingleBlockRegion(), printOneResultOp(), shouldPrintElementsAttrWithHex(), mlir::impl::verifyCastInterfaceOp(), mlir::OpTrait::impl::verifyCompatibleOperandBroadcast(), mlir::OpTrait::impl::verifyElementwise(), mlir::OpTrait::impl::verifyOperandsAreFloatLike(), mlir::OpTrait::impl::verifyOperandsAreSignlessIntegerLike(), mlir::OpTrait::impl::verifySameOperandsAndResultShape(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), mlir::OpTrait::impl::verifySameOperandsShape(), mlir::OpTrait::impl::verifySameTypeOperands(), verifyShapeOrExtentTensorOp(), and verifySizeOrIndexOp().
Definition at line 312 of file Operation.h.
Referenced by getOperand(), mlir::linalg::hoistRedundantVectorTransfersOnTensor(), and setOperand().
|
inline |
Definition at line 307 of file Operation.h.
Referenced by annotateOpsWithBufferizationMarkers(), assertDestinationPassingStyle(), checkAliasInfoConsistency(), mlir::spirv::Deserializer::collect(), dropAllReferences(), mlir::bufferization::eliminateAllocTensors(), mlir::memref::foldMemRefCast(), foldMemRefCast(), mlir::tensor::foldTensorCast(), foldTensorCast(), mlir::bufferization::OneShotAnalysisState::gatherYieldedTensors(), mlir::bufferization::func_ext::CallOpInterface::getAliasingOpOperand(), mlir::OpOperand::getOperandNumber(), getOperands(), mlir::OperationFolder::getOrCreateConstant(), inlineRegionAndEmitStore(), AllocaScopeHoister::matchAndRewrite(), replaceUsesOfWith(), setInPlaceOpOperand(), and mlir::visitUsedValuesDefinedAbove().
Definition at line 345 of file Operation.h.
References getResult().
Referenced by applyTilingToAll().
|
inline |
Definition at line 344 of file Operation.h.
References getResults().
Referenced by dropAllUses(), mlir::bufferization::OneShotAnalysisState::gatherUndefinedTensorUses(), mlir::bufferization::func_ext::CallOpInterface::getAliasingOpResult(), isUsedOutsideOfBlock(), and mlir::bufferization::replaceOpWithBufferizedValues().
|
inline |
Return the closest surrounding parent operation that is of type 'OpTy'.
Definition at line 176 of file Operation.h.
Referenced by mlir::LLVM::createGlobalString(), createSourceLocationInfo(), getAllocEffectFor(), getLibraryCallSymbolRef(), mlir::scf::insideMutuallyExclusiveBranches(), mlir::insideMutuallyExclusiveRegions(), isMemRefNormalizable(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), mlir::replaceAllMemRefUsesWith(), and validateSupportedControlFlow().
|
inline |
Returns the closest surrounding operation that contains this operation or nullptr if this is a top-level operation.
Definition at line 172 of file Operation.h.
References getParentOp().
Referenced by assertDestinationPassingStyle(), mlir::DataLayout::closest(), collectParentLayouts(), collectSymbolScopes(), collectValidReferencesFor(), mlir::DataLayoutAnalysis::DataLayoutAnalysis(), declareReduction(), mlir::SymbolTable::erase(), mlir::Block::findAncestorOpInBlock(), findAncestorOpInRegion(), mlir::Region::findAncestorOpInRegion(), findOptimal(), mlir::bufferization::OneShotAnalysisState::gatherYieldedTensors(), mlir::DataLayoutAnalysis::getAbove(), mlir::LLVM::ModuleTranslation::getAccessGroup(), mlir::LLVM::ModuleTranslation::getAliasScope(), getAllocEffectFor(), getAtMostNEnclosingLoops(), getAutomaticAllocationScope(), mlir::AnalysisManager::getCachedChildAnalysis(), mlir::detail::DominanceInfoBase< true >::getDominanceInfo(), mlir::getEnclosingAffineForAndIfOps(), mlir::getEnclosingRepetitiveRegion(), mlir::getLoopIVs(), mlir::SymbolTable::getNearestSymbolTable(), mlir::getNestingDepth(), getOrInsertBuiltinVariable(), getParentOp(), getParentWithTrait(), mlir::spirv::getPushConstantValue(), happensBefore(), hasNoInterveningEffect(), mlir::SymbolTable::insert(), isComputeOperation(), mlir::linalg::TileLoopNest::isEmpty(), isNestedInFunctionOpInterface(), mlir::isNotBranchOpInterfaceOrReturnLikeOp(), mlir::detail::ConversionPatternRewriterImpl::isOpIgnored(), isProperAncestor(), mlir::isTopLevelValue(), mlir::spirv::lookupEntryPointABI(), lookupSymbolInModule(), mlir::spirv::lookupTargetEnv(), AllocaScopeHoister::matchAndRewrite(), mlir::matchReduction(), mlir::AnalysisManager::nest(), mlir::detail::PassCrashReproducerGenerator::prepareReproducerFor(), mlir::CallGraph::print(), print(), mlir::Block::print(), printAtomicReductionRegion(), printOperation(), mlir::SymbolUserMap::replaceAllUsesWith(), vectorizeConstant(), verifyHasBindingUse(), verifySymbolAttribute(), mlir::OpTrait::HasParent< ParentOpTypes >::Impl< ConcreteType >::verifyTrait(), visit(), and walkReferencedSymbolNodes().
|
inline |
Returns the region to which the instruction belongs.
Returns nullptr if the instruction is unlinked.
Definition at line 168 of file Operation.h.
Referenced by findAncestorOpInRegion(), mlir::Region::findAncestorOpInRegion(), mlir::getAffineScope(), mlir::getEnclosingRepetitiveRegion(), mlir::Region::getParentRegion(), hasNoInterveningEffect(), mlir::isTopLevelValue(), mlir::isValidSymbol(), lastNonTerminatorInRegion(), mlir::moveLoopInvariantCode(), mlir::transform::TransformState::removeExtension(), and verifyTerminatorSuccessors().
|
inline |
Returns the closest surrounding parent operation with trait Trait
.
Definition at line 186 of file Operation.h.
References getParentOp(), hasTrait(), and isProperAncestor().
Referenced by getAllocEffectFor(), getDumpRootOp(), verifyMemoryOpIndexing(), and mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait().
Returns the region held by this operation at position 'index'.
Definition at line 484 of file Operation.h.
References getRegions().
Referenced by castBoolToIntN(), clone(), mlir::spirv::Deserializer::collect(), containsReturn(), create(), createDecl(), mlir::function_interface_impl::eraseFunctionArguments(), getBackwardSliceImpl(), mlir::bufferization::getGlobalFor(), getModuleBody(), getOrInsertBuiltinVariable(), mlir::spirv::getPushConstantValue(), mlir::SymbolTable::insert(), mlir::function_interface_impl::insertFunctionArguments(), mlir::SymbolTable::lookupSymbolIn(), mlir::transform::detail::mapPossibleTopLevelTransformOpBlockArguments(), mlirLinalgFillBuiltinNamedOpRegion(), mlirOperationGetFirstRegion(), mlirRegionGetNextInOperation(), mlir::function_interface_impl::printFunctionSignature(), mlir::vector::splitFullAndPartialTransfer(), mlir::SymbolTable::SymbolTable(), mlir::SymbolUserMap::SymbolUserMap(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), verifyRegionAttribute(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait(), mlir::detail::verifySymbolTable(), mlir::OpTrait::SingleBlock< ConcreteType >::verifyTrait(), and verifyTypesAlongAllEdges().
|
inline |
Returns the regions held by this operation.
Definition at line 478 of file Operation.h.
Referenced by mlir::applyPatternsAndFoldGreedily(), mlir::bufferization::BufferizationAliasInfo::BufferizationAliasInfo(), buildUnresolvedTargetMaterialization(), mlir::OpBuilder::clone(), mlir::Region::cloneInto(), collectCallOps(), computeCallGraph(), create(), detachNestedAndErase(), dfsPostorder(), diagnoseInvalidOperandDominance(), dropAllDefinedValueUses(), dropAllReferences(), mlir::LLVM::ensureDistinctSuccessors(), findOptimal(), getForwardSliceImpl(), mlir::getInnermostParallelLoops(), getLspDiagnoticFromDiag(), getRegion(), mlir::Region::getRegionNumber(), isMemRefNormalizable(), mlir::isSideEffectFree(), mlir::detail::ConversionPatternRewriterImpl::markNestedOpsIgnored(), AllocaScopeHoister::matchAndRewrite(), mayBeValidWithoutTerminator(), mergeIdenticalBlocks(), mlir::scf::naivelyFuseParallelOps(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), mlir::linalg::populateElementwiseOpsFusionPatterns(), mlir::AsmPrinter::Impl::printIntegerSet(), propagateLiveness(), shouldPrintElementsAttrWithHex(), validateSupportedControlFlow(), mlir::detail::verifyInferredResultTypes(), mlir::OpTrait::impl::verifyIsIsolatedFromAbove(), mlir::OpTrait::impl::verifyNoRegionArguments(), mlir::detail::verifySymbolTable(), mlir::detail::walk(), JamBlockGatherer::walk(), mlir::SymbolTable::walkSymbolTables(), walkSymbolUses(), and wouldOpBeTriviallyDeadImpl().
|
inline |
If this operation has a registered operation description, return it.
Otherwise return None.
Definition at line 61 of file Operation.h.
References getName(), and mlir::OperationName::getRegisteredInfo().
Referenced by mlir::Op< AffineDmaStartOp, OpTrait::MemRefsNormalizable, OpTrait::VariadicOperands, OpTrait::ZeroResults, OpTrait::OpInvariants, AffineMapAccessInterface::Trait >::classof(), fold(), mlir::OpPassManager::getNesting(), mlir::AsmPrinter::Impl::printIntegerSet(), and shouldPrintElementsAttrWithHex().
Get the 'idx'th result of this operation.
Definition at line 331 of file Operation.h.
Referenced by addRuntimePreemptionSpecifier(), mlir::affineParallelize(), mlir::AllocLikeOpLLVMLowering::AllocLikeOpLLVMLowering(), analyzeProfitability(), mlir::Op< AffineDmaStartOp, OpTrait::MemRefsNormalizable, OpTrait::VariadicOperands, OpTrait::ZeroResults, OpTrait::OpInvariants, AffineMapAccessInterface::Trait >::attachInterface(), mlir::bufferization::func_ext::CallOpInterface::bufferize(), buildVectorWrite(), clone(), mlir::spirv::Deserializer::collect(), convertElementwiseOp(), convertOmpThreadprivate(), convertOperationImpl(), createLinalgBodyCalculationForElementwiseOp(), mlir::vector::distributPointwiseVectorOp(), elementwiseMatchAndRewriteHelper(), executeGetOperandsResults(), extractOpcode(), mlir::op_definition_impl::foldTrait(), mlir::linalg::TileLoopNest::fuseProducer(), mlir::linalg::generateLibraryCallName(), genForInduction(), getCollapsedOpOperand(), getEnclosingforOps(), getIdentity(), getLLVMAtomicOrdering(), getLspDiagnoticFromDiag(), getOpResult(), mlir::OperationFolder::getOrCreateConstant(), getTargetShape(), mlir::nvgpu::getWarpMatrixInfo(), mlir::LLVM::detail::handleMultidimensionalVectors(), isMemRefNormalizable(), isSumOfMul(), joinShapes(), mlir::detail::constant_float_op_binder::match(), mlir::detail::constant_int_op_binder::match(), matchAndReplaceDepthwiseConv(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), VectorizeConvolution::matchAndRewrite(), TransferReadToVectorLoadLowering::matchAndRewrite(), materializeConversion(), mlir::normalizeAffineFor(), mlir::OperationFolder::notifyRemoval(), mlir::LLVM::detail::oneToOneRewrite(), mlir::outlineSingleBlockRegion(), printConstantOp(), mlir::OpAsmPrinter::printFunctionalType(), printGroupNonUniformArithmeticOp(), mlir::AsmPrinter::Impl::printIntegerSet(), printOneResultOp(), printOperation(), reduceMatchAndRewriteHelper(), splatZero(), mlir::RewriterBase::splitBlock(), mlir::linalg::splitReduction(), mlir::OperationFolder::tryToFold(), vectorizeOperand(), verifyCastOp(), verifyCoopMatrixMulAdd(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), verifyShiftOp(), and walkReferenceCountedValues().
|
inline |
Definition at line 339 of file Operation.h.
Referenced by analyzeProfitability(), mlir::applyPatternsAndFoldGreedily(), mlir::bufferization::BufferizationAliasInfo::BufferizationAliasInfo(), buildVectorWrite(), checkAndNestUnderRewriteOp(), mlir::async::cloneConstantsIntoTheRegion(), mlir::OperationEquivalence::computeHash(), dfsPostorder(), elementwiseMatchAndRewriteHelper(), extractBeneficiaryOps(), mlir::impl::foldCastInterfaceOp(), mlir::linalg::generateLibraryCallName(), getAsValue(), getForwardSliceImpl(), getLastDependentOpInRange(), getLspDiagnoticFromDiag(), getOpResults(), getResultTypes(), mlir::linalg::getUpperBoundForIndex(), getUses(), mlir::linalg::ExtractSliceOfPadTensorSwapPattern::matchAndRewrite(), mlir::detail::ConversionPatternRewriterImpl::notifyOpReplaced(), mlir::outlineSingleBlockRegion(), peelLoop(), mlir::Liveness::print(), mlir::OpAsmPrinter::printFunctionalType(), mlir::AsmPrinter::Impl::printIntegerSet(), printOperation(), processParallelLoop(), propagateLiveness(), reduceMatchAndRewriteHelper(), mlir::replaceAllMemRefUsesWith(), replaceAllUsesWith(), mlir::ResultRange::replaceAllUsesWith(), mlir::RewriterBase::replaceOpWithIf(), mlir::bufferization::replaceOpWithNewBufferizedOp(), result_begin(), result_end(), mlir::sinkOperationsIntoLaunchOp(), mlir::RewriterBase::splitBlock(), mlir::OpBuilder::tryFold(), use_begin(), use_empty(), use_end(), validateSupportedControlFlow(), vectorizeAsLinalgGeneric(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), and widenOp().
|
inline |
Definition at line 352 of file Operation.h.
References getResults(), and mlir::ResultRange::getTypes().
Referenced by clone(), mlir::OperationEquivalence::computeHash(), equivalenceAnalysis(), getOpToConvert(), getOrCreateOperandsMatchingResultTypes(), hasTensorSemantics(), insertCasts(), mlir::TypeConverter::isLegal(), mlir::LLVM::detail::oneToOneRewrite(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), mlir::outlineSingleBlockRegion(), printNamedStructuredOp(), printNVVMIntrinsicOp(), result_type_begin(), result_type_end(), shouldPrintElementsAttrWithHex(), sourceMaterializationCallback(), splatZero(), vectorizeOneOp(), mlir::impl::verifyCastInterfaceOp(), mlir::OpTrait::impl::verifyCompatibleOperandBroadcast(), mlir::OpTrait::impl::verifyElementwise(), mlir::detail::verifyInferredResultTypes(), mlir::OpTrait::impl::verifyResultsAreBoolLike(), mlir::OpTrait::impl::verifyResultsAreFloatLike(), mlir::OpTrait::impl::verifyResultsAreSignlessIntegerLike(), mlir::OpTrait::impl::verifySameOperandsAndResultShape(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), verifyShapeOrExtentTensorOp(), verifySizeOrIndexOp(), mlir::detail::verifyTypesAlongControlFlowEdges(), and walkReferenceCountedValues().
Definition at line 506 of file Operation.h.
References fold(), getBlockOperands(), getNumSuccessors(), and setSuccessor().
Referenced by eraseTerminatorSuccessorOperands(), getPHISourceValue(), mlir::Block::getSuccessor(), propagateTerminatorLiveness(), validateSupportedControlFlow(), and mlir::detail::verifyBranchSuccessorOperands().
|
inline |
Definition at line 501 of file Operation.h.
Referenced by clone(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), mlir::AsmPrinter::Impl::printIntegerSet(), propagateTerminatorLiveness(), successor_begin(), successor_end(), verifyTerminatorSuccessors(), and walkReferenceCountedValues().
|
inline |
Returns a range of all users.
Definition at line 648 of file Operation.h.
References emitError(), emitOpError(), emitRemark(), emitWarning(), mlir::detail::OpResultImpl::getMaxInlineResults(), getNumResults(), user_begin(), and user_end().
Referenced by mlir::applyPatternsAndFoldGreedily(), collapseBranch(), create(), mlir::createLoopFusionPass(), dfsPostorder(), findAncestorOpInRegion(), mlir::bufferization::BufferPlacementTransformationBase::findCommonDominator(), findMatchingTransferRead(), getForwardSliceImpl(), mlir::nvgpu::getWarpMatrixInfo(), hasBindingUse(), inferFragType(), insertionPointDominatesUses(), mlir::matchReduction(), mlir::moveLoopInvariantCode(), mlir::memref::multiBuffer(), mlir::AsmPrinter::Impl::printIntegerSet(), verifyResultTypesAreInferrable(), and visit().
|
inline |
Returns a range of all uses, which is useful for iterating over all uses.
Definition at line 621 of file Operation.h.
References getResults(), and mlir::ResultRange::getUses().
Referenced by mlir::bufferization::bufferizeOp(), hasOneUse(), and replaceUsesAndPropagateType().
|
inline |
Return true if the operation has an attribute with the provided name, false otherwise.
Definition at line 392 of file Operation.h.
Referenced by getAssumedUniqueReturnOp().
|
inline |
Definition at line 393 of file Operation.h.
|
inline |
Definition at line 395 of file Operation.h.
|
inline |
Returns true if this operation has exactly one use.
Definition at line 624 of file Operation.h.
References getUses().
Referenced by mlir::matchReduction().
|
inline |
Definition at line 503 of file Operation.h.
|
inline |
Returns true if the operation was registered with a particular trait, e.g.
hasTrait<OperandsAreSignlessIntegerLike>().
Definition at line 526 of file Operation.h.
References mlir::OperationName::hasTrait().
Referenced by canBeHoisted(), mlir::async::cloneConstantsIntoTheRegion(), collectSymbolScopes(), collectValidReferencesFor(), mlir::OperationEquivalence::computeHash(), diagnoseInvalidOperandDominance(), eachHasOnlyOneOfTypes(), mlir::impl::ensureRegionTerminator(), executeGetOperandsResults(), extractOpcode(), mlir::op_definition_impl::foldTrait(), getBackwardSliceImpl(), getCommonBlock(), getLspDiagnoticFromDiag(), mlir::LocalAliasAnalysis::getModRef(), mlir::getMutableRegionBranchSuccessorOperands(), mlir::SymbolTable::getNearestSymbolTable(), mlir::OperationFolder::getOrCreateConstant(), getParentWithTrait(), mlir::OpTrait::hasElementwiseMappableTraits(), inlineCallsInSCC(), mlir::detail::isConstantLike(), isDirectInModuleLikeOp(), mlir::OperationEquivalence::isEquivalentTo(), mlir::isLegalForReturnOpTypeConversionPattern(), isMemRefNormalizable(), isNestedInFunctionOpInterface(), isOpItselfPotentialAutomaticAllocation(), mlir::isRegionReturnLike(), mlir::isSideEffectFree(), mlir::isTopLevelValue(), isUseSpeciallyKnownDead(), mlir::isValidSymbol(), mlir::SymbolTable::lookupSymbolIn(), lookupSymbolInImpl(), AllocaScopeHoister::matchAndRewrite(), mayBeValidWithoutTerminator(), mlirBlockGetTerminator(), print(), propagateLiveness(), remainsLegalAfterInline(), mlir::LLVM::satisfiesLLVMModule(), shouldPrintElementsAttrWithHex(), mlir::sortTopologically(), mlir::SymbolTable::SymbolTable(), verifyCoopMatrixMulAdd(), mlir::OpTrait::impl::verifyIsIsolatedFromAbove(), mlir::SymbolTable::walkSymbolTables(), walkSymbolUses(), and wouldOpBeTriviallyDeadImpl().
void Operation::insertOperands | ( | unsigned | index, |
ValueRange | operands | ||
) |
Insert the given operands into the operand list at the given 'index'.
Definition at line 219 of file Operation.cpp.
References setOperands().
Referenced by mlir::gpu::addAsyncDependency(), addExecuteResults(), mlir::MutableOperandRange::append(), and replaceAllUsesWith().
|
inline |
Return true if this operation is an ancestor of the other
operation.
An operation is considered as its own ancestor, use isProperAncestor
to avoid this.
Definition at line 201 of file Operation.h.
References isProperAncestor(), and replaceUsesOfWith().
Referenced by canBeHoisted(), collectValidReferencesFor(), dependsOnCarriedVals(), mlir::OpPassManager::getNesting(), and hasNoInterveningEffect().
bool Operation::isBeforeInBlock | ( | Operation * | other | ) |
Given an operation 'other' that is within the same parent block, return whether the current operation is before 'other' in the operation list of the parent block.
Note: This function has an average complexity of O(1), but worst case may take O(N) where N is the number of operations within the parent block.
Definition at line 271 of file Operation.cpp.
References mlir::Block::back(), mlir::Block::front(), mlir::Block::isOpOrderValid(), and mlir::Block::recomputeOpOrder().
Referenced by mlir::detail::ConversionPatternRewriterImpl::applyRewrites(), mlir::createLoopFusionPass(), funcsToCoroutines(), mlir::LivenessBlockInfo::getEndOperation(), getFusedLoopNestInsertionPoint(), hasNonAffineUsersOnThePath(), mlir::Liveness::isDeadAfter(), isFusionProfitable(), mlir::detail::DominanceInfoBase< true >::isReachableFromEntry(), mayExistInterleavedUses(), mlir::PostDominanceInfo::properlyPostDominates(), replaceAllUsesWith(), validateSupportedControlFlow(), and verifyResultTypesAreInferrable().
bool Operation::isProperAncestor | ( | Operation * | other | ) |
Return true if this operation is a proper ancestor of the other
operation.
Definition at line 182 of file Operation.cpp.
References getParentOp().
Referenced by getParentWithTrait(), happensBefore(), isAncestor(), isLocallyDefined(), mlir::AnalysisManager::nest(), mlir::replaceLoopWithNewYields(), and mlir::RewriterBase::replaceOpWithinBlock().
|
inline |
Returns true if this operation has a registered operation description, otherwise false.
Definition at line 67 of file Operation.h.
References erase(), getName(), and mlir::OperationName::isRegistered().
|
inline |
Returns true if the results of this operation are used outside of the given block.
Definition at line 631 of file Operation.h.
References getOpResults(), and mlir::Value::isUsedOutsideOfBlock().
|
inline |
Returns true if the operation might have the provided trait.
This means that either the operation is unregistered, or it was registered with the provide trait.
Definition at line 534 of file Operation.h.
References mlir::OperationName::mightHaveTrait(), and mlir::PostOrder.
Referenced by create(), ensureDistinctSuccessors(), mlir::isNotBranchOpInterfaceOrReturnLikeOp(), isTerminator(), mlir::matchReduction(), mayBeValidWithoutTerminator(), and mlir::wouldOpBeTriviallyDead().
Unlink this operation from its current block and insert it right after existingOp
which may be in the same or another block in the same function.
Definition at line 454 of file Operation.cpp.
References getBlock().
Referenced by replaceAllUsesWith(), and validateSupportedControlFlow().
Unlink this operation from its current block and insert it right after iterator
in the specified block.
Definition at line 460 of file Operation.cpp.
References mlir::Block::end(), and moveBefore().
Unlink this operation from its current block and insert it right before existingOp
which may be in the same or another block in the same function.
Definition at line 440 of file Operation.cpp.
References getBlock().
Referenced by checkInvarianceOfNestedIfOps(), hasAllocationScope(), mlir::OperationFolder::insertKnownConstant(), moveAfter(), replaceAllUsesWith(), and mlir::OperationFolder::tryToFold().
Unlink this operation from its current block and insert it right before iterator
in the specified block.
Unlink this operation from its current basic block and insert it right before iterator
in the specified basic block.
Definition at line 446 of file Operation.cpp.
References getBlock(), and mlir::Block::getOperations().
|
inline |
Definition at line 298 of file Operation.h.
References getOperands().
Referenced by mlir::applyPatternsAndFoldGreedily(), logFailure(), operand_type_begin(), and mlir::replaceAllMemRefUsesWith().
|
inline |
Definition at line 299 of file Operation.h.
References getOperands().
Referenced by mlir::applyPatternsAndFoldGreedily(), logFailure(), operand_type_end(), and mlir::replaceAllMemRefUsesWith().
|
inline |
Definition at line 319 of file Operation.h.
References operand_begin().
Referenced by checkAndUpdateCapabilityRequirements(), and mlir::SPIRVConversionTarget::get().
|
inline |
Definition at line 320 of file Operation.h.
References operand_end().
Referenced by checkAndUpdateCapabilityRequirements(), and mlir::SPIRVConversionTarget::get().
void Operation::print | ( | raw_ostream & | os, |
const OpPrintingFlags & | flags = llvm::None |
||
) |
Definition at line 3111 of file AsmPrinter.cpp.
References mlir::AsmState::getImpl(), getParentOp(), hasTrait(), mlir::detail::AsmStateImpl::initializeAliases(), print(), and mlir::OpPrintingFlags::shouldUseLocalScope().
Referenced by mlir::Diagnostic::appendOp(), mlir::spirv::Deserializer::collect(), mlir::detail::RecoveryReproducerContext::generate(), generateLocationsFromIR(), getLspDiagnoticFromDiag(), mlir::ConversionPattern::matchAndRewrite(), mlir::operator<<(), mlir::Liveness::print(), mlir::Value::print(), printIR(), and replaceAllUsesWith().
Definition at line 3139 of file AsmPrinter.cpp.
References mlir::AsmState::getImpl(), mlir::AsmState::getPrinterFlags(), and mlir::OpPrintingFlags::shouldUseLocalScope().
void Operation::remove | ( | ) |
Remove the operation from its parent block, but don't delete it.
Definition at line 432 of file Operation.cpp.
References getBlock().
|
inline |
Remove the attribute with the specified name if it exists.
Return the attribute that was erased, or nullptr if there was no attribute with such name.
Definition at line 414 of file Operation.h.
References mlir::NamedAttrList::erase(), getContext(), and mlir::NamedAttrList::getDictionary().
Referenced by lowerEntryPointABIAttr(), removeAttr(), mlir::linalg::LinalgTransformationFilter::replaceLinalgTransformationFilter(), setAllArgResAttrDicts(), mlir::function_interface_impl::detail::setArgResAttrDict(), mlir::function_interface_impl::setFunctionType(), and mlir::SymbolTable::setSymbolVisibility().
|
inline |
Definition at line 421 of file Operation.h.
References getContext(), and removeAttr().
|
inline |
Replace all uses of results of this operation with the provided 'values'.
Definition at line 210 of file Operation.h.
References destroy(), dropAllDefinedValueUses(), dropAllReferences(), dump(), getResults(), insertOperands(), isBeforeInBlock(), moveAfter(), moveBefore(), print(), mlir::ResultRange::replaceAllUsesWith(), and setOperands().
Referenced by convertToLaunchFuncOp(), hasAllocationScope(), mlir::OperationFolder::insertKnownConstant(), isMemRefNormalizable(), mlir::linalg::LinalgBaseTileAndFusePattern::matchAndRewrite(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), mlir::promoteIfSingleIteration(), mlir::replaceAllMemRefUsesWith(), mlir::RewriterBase::replaceOp(), and updateCalls().
Replace any uses of 'from' with 'to' within this operation.
Definition at line 190 of file Operation.cpp.
References getOpOperands().
Referenced by mlir::inlineCall(), and isAncestor().
|
inline |
Definition at line 337 of file Operation.h.
References getResults().
Referenced by mlir::OperationFolder::create(), and mlir::linalg::generateLibraryCallName().
|
inline |
Definition at line 338 of file Operation.h.
References getResults().
Referenced by mlir::OperationFolder::create(), and mlir::linalg::generateLibraryCallName().
|
inline |
Definition at line 350 of file Operation.h.
References getResultTypes().
Referenced by checkAndUpdateCapabilityRequirements(), mlir::SPIRVConversionTarget::get(), mlir::OperationFolder::insertKnownConstant(), and materializeConversion().
|
inline |
Definition at line 351 of file Operation.h.
References getResultTypes().
Referenced by checkAndUpdateCapabilityRequirements(), and mlir::SPIRVConversionTarget::get().
If the an attribute exists with the specified name, change it to the new value.
Otherwise, add a new attribute with the specified name/value.
Definition at line 402 of file Operation.h.
References getContext(), mlir::NamedAttrList::getDictionary(), mlir::NamedAttrList::set(), and value.
Referenced by mlir::gpu::addAsyncDependency(), annotateConflict(), mlir::spirv::Deserializer::collect(), convertToLaunchFuncOp(), createBufferAllocation(), mlir::function_interface_impl::eraseFunctionArguments(), mlir::function_interface_impl::eraseFunctionResults(), getAssumedUniqueReturnOp(), getLibraryCallSymbolRef(), mlir::function_interface_impl::insertFunctionArguments(), mlir::function_interface_impl::insertFunctionResults(), mlir::linalg::LinalgTransformationFilter::replaceLinalgTransformationFilter(), setAllArgResAttrDicts(), mlir::function_interface_impl::detail::setArgResAttrDict(), setAttr(), mlir::function_interface_impl::setFunctionType(), setInPlaceOpOperand(), mlir::SymbolTable::setSymbolName(), mlir::SymbolTable::setSymbolVisibility(), setupCoroMachinery(), mlir::MutableOperandRange::split(), mlir::vector::splitFullAndPartialTransfer(), and wrapExternalFunction().
Definition at line 407 of file Operation.h.
References getContext(), and setAttr().
|
inline |
Set the attribute dictionary on this operation.
Definition at line 369 of file Operation.h.
Referenced by mlir::bufferization::func_ext::CallOpInterface::bufferize(), mlir::scf::buildLoopNest(), logFailure(), replaceAllSymbolUsesImpl(), setAttrs(), and setDialectAttrs().
|
inline |
Definition at line 373 of file Operation.h.
References getContext(), and setAttrs().
|
inline |
Set the dialect attributes for this operation, and preserve all dependent.
Definition at line 461 of file Operation.h.
References mlir::NamedAttrList::append(), getAttrs(), getContext(), mlir::NamedAttrList::getDictionary(), mlir::NamedAttrList::push_back(), and setAttrs().
Set the source location the operation was defined or derived from.
Definition at line 164 of file Operation.h.
Referenced by generateLocationsFromIR(), and logFailure().
Definition at line 275 of file Operation.h.
References getOpOperand(), and mlir::IROperand< DerivedT, IRValueT >::set().
Referenced by mlir::MutableOperandRange::assign(), collapseGenericOpIterationDims(), mlir::createAffineComputationSlice(), mlir::replaceAllMemRefUsesWith(), mlir::linalg::splitReduction(), and validateSupportedControlFlow().
void Operation::setOperands | ( | ValueRange | operands | ) |
Replace the current operands of this operation with the ones provided in 'operands'.
Definition at line 200 of file Operation.cpp.
References mlir::detail::OperandStorage::setOperands().
Referenced by mlir::affineParallelize(), mlir::MutableOperandRange::assign(), generateUnrolledLoop(), insertOperands(), logFailure(), and replaceAllUsesWith().
void Operation::setOperands | ( | unsigned | start, |
unsigned | length, | ||
ValueRange | operands | ||
) |
Replace the operands beginning at 'start' and ending at 'start' + 'length' with the ones provided in 'operands'.
'operands' may be smaller or larger than the range pointed to by 'start'+'length'.
Definition at line 209 of file Operation.cpp.
References getNumOperands(), and mlir::detail::OperandStorage::setOperands().
Definition at line 490 of file Operation.cpp.
References getBlockOperands(), and getNumSuccessors().
Referenced by getSuccessor(), logFailure(), and walkReferenceCountedValues().
|
inline |
|
inline |
|
inline |
Definition at line 617 of file Operation.h.
References getResults(), and mlir::ResultRange::use_begin().
Referenced by user_begin().
|
inline |
Returns true if this operation has no uses.
Definition at line 627 of file Operation.h.
References getResults(), and mlir::ResultRange::use_empty().
Referenced by checkInvarianceOfNestedIfOps(), mlir::spirv::Deserializer::collect(), create(), mlir::RewriterBase::eraseBlock(), mlir::RewriterBase::eraseOp(), mlir::isOpTriviallyDead(), and mlir::AsmPrinter::Impl::printIntegerSet().
|
inline |
Definition at line 618 of file Operation.h.
References getResults(), and mlir::ResultRange::use_end().
Referenced by user_end().
|
inline |
|
inline |
|
inline |
Walk the operation by calling the callback for each nested operation (including this one), block or region, depending on the callback provided.
Regions, blocks and operations at the same nesting level are visited in lexicographical order. The walk order for enclosing regions, blocks and operations with respect to their nested ones is specified by 'Order' (post-order by default). A callback on a block or operation is allowed to erase that block or operation if either:
The callback method can take any of the following forms: void(Operation*) : Walk all operations opaquely.
Definition at line 572 of file Operation.h.
Referenced by mlir::bufferization::analyzeOp(), annotateOpsWithBufferizationMarkers(), assertDestinationPassingStyle(), mlir::bufferization::BufferizationAliasInfo::BufferizationAliasInfo(), mlir::bufferization::bufferizeOp(), mlir::bufferization::BufferPlacementAllocs::BufferPlacementAllocs(), buildBlockMapping(), canBeHoisted(), checkAliasInfoConsistency(), mlir::OpBuilder::clone(), convertToLaunchFuncOp(), mlir::bufferization::createAllocDeallocOps(), mlir::createLoopFusionPass(), mlir::DataLayoutAnalysis::DataLayoutAnalysis(), mlir::bufferization::deallocateBuffers(), mlir::LLVM::detail::DebugTranslation::DebugTranslation(), doubleBuffer(), mlir::bufferization::eliminateAllocTensors(), mlir::LLVM::ensureDistinctSuccessors(), equivalenceAnalysis(), mlir::finalizeParallelLoopToGPUConversion(), mlir::bufferization::OneShotAnalysisState::gatherUndefinedTensorUses(), mlir::bufferization::OneShotAnalysisState::gatherYieldedTensors(), generateLocationsFromIR(), getFirstDependentOpInRange(), getLastDependentOpInRange(), getLoadAndStoreMemRefAccesses(), getOpToConvert(), hasNonAffineUsersOnThePath(), inPlaceAnalysis(), mlir::detail::ConversionPatternRewriterImpl::markNestedOpsIgnored(), mlir::NestedPattern::match(), mlir::bufferization::OneShotAnalysisState::OneShotAnalysisState(), mlir::Liveness::print(), mlir::BufferViewFlowAnalysis::remove(), mlir::vector::transferOpflowOpt(), validateSupportedControlFlow(), and walkReferenceCountedValues().
|
inline |
Generic walker with a stage aware callback.
Walk the operation by calling the callback for each nested operation (including this one) N+1 times, where N is the number of regions attached to that operation.
The callback method can take any of the following forms: void(Operation *, const WalkStage &) : Walk all operation opaquely
Definition at line 600 of file Operation.h.
References mlir::detail::walk().
Definition at line 782 of file Operation.h.
Definition at line 788 of file Operation.h.
Definition at line 779 of file Operation.h.
Definition at line 785 of file Operation.h.