MLIR  16.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
mlir::Operation Class Referencefinal

Operation is a basic unit of execution within MLIR. More...

#include "mlir/IR/Operation.h"

+ Inheritance diagram for mlir::Operation:
+ Collaboration diagram for mlir::Operation:

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< RegisteredOperationNamegetRegisteredInfo ()
 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...
 
Operationclone (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...
 
Operationclone (CloneOptions options=CloneOptions::all())
 
OperationcloneWithoutRegions (BlockAndValueMapping &mapper)
 Create a partial copy of this operation without traversing into attached regions. More...
 
OperationcloneWithoutRegions ()
 Create a partial copy of this operation without traversing into attached regions. More...
 
BlockgetBlock ()
 Returns the operation block that contains this operation. More...
 
MLIRContextgetContext ()
 Return the context this operation is associated with. More...
 
DialectgetDialect ()
 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...
 
RegiongetParentRegion ()
 Returns the region to which the instruction belongs. More...
 
OperationgetParentOp ()
 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>
OperationgetParentWithTrait ()
 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< OpOperandgetOpOperands ()
 
OpOperandgetOpOperand (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< NamedAttributegetAttrs ()
 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...
 
void populateDefaultAttrs ()
 Sets default attributes on unset attributes. More...
 
unsigned getNumRegions ()
 Returns the number of regions held by this operation. More...
 
MutableArrayRef< RegiongetRegions ()
 Returns the regions held by this operation. More...
 
RegiongetRegion (unsigned index)
 Returns the region held by this operation at position 'index'. More...
 
MutableArrayRef< BlockOperandgetBlockOperands ()
 
succ_iterator successor_begin ()
 
succ_iterator successor_end ()
 
SuccessorRange getSuccessors ()
 
bool hasSuccessors ()
 
unsigned getNumSuccessors ()
 
BlockgetSuccessor (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_t< llvm::function_traits< std::decay_t< FnT > >::num_args==1, RetT > 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_t< llvm::function_traits< std::decay_t< FnT > >::num_args==2, RetT > 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 Operationcreate (Location location, OperationName name, TypeRange resultTypes, ValueRange operands, NamedAttrList &&attributes, BlockRange successors, unsigned numRegions)
 Create a new Operation with the specific fields. More...
 
static Operationcreate (const OperationState &state)
 Create a new Operation from the fields stored in state. More...
 
static Operationcreate (Location location, OperationName name, TypeRange resultTypes, ValueRange operands, NamedAttrList &&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 >
 

Detailed Description

Operation is a basic unit of execution within MLIR.

Operations can be nested within Regions 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.

Member Typedef Documentation

◆ dialect_attr_range

Definition at line 435 of file Operation.h.

◆ operand_iterator

using mlir::Operation::operand_iterator = operand_range::iterator

Definition at line 289 of file Operation.h.

◆ operand_range

Definition at line 288 of file Operation.h.

◆ operand_type_iterator

Definition at line 310 of file Operation.h.

◆ operand_type_range

Definition at line 311 of file Operation.h.

◆ result_iterator

using mlir::Operation::result_iterator = result_range::iterator

Definition at line 328 of file Operation.h.

◆ result_range

Support result iteration.

Definition at line 327 of file Operation.h.

◆ result_type_iterator

Support result type iteration.

Definition at line 341 of file Operation.h.

◆ result_type_range

Definition at line 342 of file Operation.h.

◆ succ_iterator

using mlir::Operation::succ_iterator = SuccessorRange::iterator

Definition at line 500 of file Operation.h.

◆ use_iterator

Definition at line 616 of file Operation.h.

◆ use_range

Definition at line 617 of file Operation.h.

◆ user_iterator

Definition at line 643 of file Operation.h.

◆ user_range

Definition at line 644 of file Operation.h.

Member Function Documentation

◆ clone() [1/2]

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 558 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(), forwardTerminatorOperands(), fuse(), mlir::linalg::generateLibraryCallName(), inlinePayload(), mlir::Operation::CloneOptions::shouldCloneOperands(), specializeForLoopForUnrolling(), specializeParallelLoopForUnrolling(), and mlir::linalg::splitReductionByScaling().

◆ clone() [2/2]

Operation * Operation::clone ( CloneOptions  options = CloneOptions::all())

Definition at line 592 of file Operation.cpp.

References clone().

◆ cloneWithoutRegions() [1/2]

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 544 of file Operation.cpp.

References mlir::Operation::CloneOptions::all(), clone(), and mlir::Operation::CloneOptions::cloneRegions().

Referenced by mlir::OpBuilder::cloneWithoutRegions().

◆ cloneWithoutRegions() [2/2]

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 548 of file Operation.cpp.

Referenced by mlir::Operation::CloneOptions::shouldCloneOperands().

◆ create() [1/3]

Operation * Operation::create ( Location  location,
OperationName  name,
TypeRange  resultTypes,
ValueRange  operands,
NamedAttrList &&  attributes,
BlockRange  successors,
unsigned  numRegions 
)
static

◆ create() [2/3]

Operation * Operation::create ( const OperationState state)
static

◆ create() [3/3]

Operation * Operation::create ( Location  location,
OperationName  name,
TypeRange  resultTypes,
ValueRange  operands,
NamedAttrList &&  attributes,
BlockRange  successors = {},
RegionRange  regions = {} 
)
static

Create a new Operation with the specific fields.

Definition at line 34 of file Operation.cpp.

References create(), getRegion(), and mlir::Region::takeBody().

◆ destroy()

void Operation::destroy ( )

Destroys this operation and its subclass data.

Destroy this operation or one of its subclasses.

Definition at line 165 of file Operation.cpp.

Referenced by mlir::OperationFolder::create(), mlir::OpBuilder::createOrFold(), llvm::ilist_traits<::mlir::Operation >::deleteNode(), erase(), and replaceAllUsesWith().

◆ dialect_attr_begin()

dialect_attr_iterator mlir::Operation::dialect_attr_begin ( )
inline

Definition at line 443 of file Operation.h.

References getAttrs().

◆ dialect_attr_end()

dialect_attr_iterator mlir::Operation::dialect_attr_end ( )
inline

Definition at line 447 of file Operation.h.

References getAttrs().

◆ dropAllDefinedValueUses()

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 476 of file Operation.cpp.

References mlir::Block::dropAllDefinedValueUses(), dropAllUses(), and getRegions().

Referenced by replaceAllUsesWith().

◆ dropAllReferences()

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 463 of file Operation.cpp.

References getBlockOperands(), getOpOperands(), and getRegions().

Referenced by mlir::Block::dropAllReferences(), and replaceAllUsesWith().

◆ dropAllUses()

void mlir::Operation::dropAllUses ( )
inline

Drop all uses of results of this operation.

Definition at line 611 of file Operation.h.

References getOpResults().

Referenced by detachNestedAndErase(), and dropAllDefinedValueUses().

◆ dump()

void Operation::dump ( )

◆ emitError()

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 225 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(), mlir::bufferization::allocateTensorForShapedValue(), alterGpuLaunch(), applyTilingToAll(), assertDestinationPassingStyle(), mlir::bufferization::bufferizeOp(), checkAffineLoopNestMappableImpl(), checkAndUpdateCapabilityRequirements(), checkAndUpdateExtensionRequirements(), mlir::MemRefRegion::compute(), computeMemRefRankReductionMask(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertOmpThreadprivate(), convertStandaloneDataOp(), convertStructType(), mlir::convertVectorToNVVMCompatibleMMASync(), createGpuLaunch(), mlir::LLVM::detail::createIntrinsicCall(), mlir::bufferization::deallocateBuffers(), mlir::bufferization::detail::defaultGetBufferType(), diagnoseInvalidOperandDominance(), eachHasOnlyOneOfTypes(), emitOpError(), findLiveUserOfReplaced(), mlir::linalg::findTopLevelForeachThreadOp(), generateLocationsFromIR(), getEnclosingforOps(), mlir::transform::TransformState::getHandleForPayloadOp(), getMemoryFootprintBytes(), getOrInsertBuiltinVariable(), mlir::spirv::getPushConstantValue(), getUsers(), mlir::nvgpu::getWarpMatrixInfo(), hasOneBranchOpTo(), mlir::insertBackwardComputationSlice(), isZeroAttribute(), legalizeUnresolvedMaterialization(), mayBeValidWithoutTerminator(), mlir::DataLayoutSpecAttr::print(), print(), printOperation(), validateSupportedControlFlow(), mlir::detail::verifyBranchSuccessorOperands(), mlir::OpTrait::impl::verifyCompatibleOperandBroadcast(), mlir::detail::verifyDataLayoutOp(), verifyFuncOpInterfaceStructAttr(), verifyMemorySemantics(), verifyNumBlockArgs(), mlir::detail::verifyParallelCombiningOpInterface(), verifyPointerAndCoopMatrixType(), verifyPointerAndJointMatrixType(), verifyRegionAttribute(), verifyShiftOp(), mlir::detail::verifySymbolTable(), verifyTerminatorSuccessors(), mlir::transform::TransformEachOpTrait< OpTy >::verifyTrait(), mlir::transform::FunctionalStyleTransformOpTrait< OpTy >::verifyTrait(), mlir::transform::NavigationTransformOpTrait< OpTy >::verifyTrait(), and walkReferenceCountedValues().

◆ emitOpError()

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 512 of file Operation.cpp.

References emitError(), and getName().

Referenced by mlir::spirv::Deserializer::collect(), create(), foldTransferInBoundsAttribute(), mlir::scf::getForeachThreadOpThreadIndexOwner(), mlir::OpPassManager::getNesting(), getUsers(), inlineCallsInSCC(), inlinePayload(), 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::linalg::detail::verifyDestinationStyleOpInterface(), mlir::OpTrait::impl::verifyElementwise(), verifyGatherOrScatterDims(), verifyGroupNonUniformArithmeticOp(), verifyHasBindingUse(), 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().

◆ emitRemark()

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 246 of file Operation.cpp.

References mlir::InFlightDiagnostic::attachNote(), diag(), mlir::emitRemark(), getContext(), and getLoc().

Referenced by emitRemarkForBlock(), and getUsers().

◆ emitWarning()

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 237 of file Operation.cpp.

References mlir::InFlightDiagnostic::attachNote(), diag(), mlir::emitWarning(), getContext(), and getLoc().

Referenced by getLibraryCallSymbolRef(), getMemoryFootprintBytes(), and getUsers().

◆ erase()

void Operation::erase ( )

◆ eraseOperand()

void mlir::Operation::eraseOperand ( unsigned  idx)
inline

Erase the operand at position idx.

Definition at line 273 of file Operation.h.

References eraseOperands().

◆ eraseOperands() [1/2]

void mlir::Operation::eraseOperands ( unsigned  idx,
unsigned  length = 1 
)
inline

Erase the operands starting at position idx and ending at position 'idx'+'length'.

Definition at line 277 of file Operation.h.

Referenced by mlir::MutableOperandRange::clear(), mlir::MutableOperandRange::erase(), and eraseOperand().

◆ eraseOperands() [2/2]

void mlir::Operation::eraseOperands ( const BitVector &  eraseIndices)
inline

Erases the operands that have their corresponding bit set in eraseIndices and removes them from the operand list.

Definition at line 283 of file Operation.h.

◆ fold()

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.

  • the elements in "operands" will correspond directly to the operands of the operation, but may be null if non-constant. If folding is successful, this fills in the results vector. If not, results is unspecified.

Definition at line 490 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(), mlir::OpBuilder::tryFold(), and mlir::dataflow::SparseConstantPropagation::visitOperation().

◆ getAttr() [1/2]

Attribute mlir::Operation::getAttr ( StringAttr  name)
inline

◆ getAttr() [2/2]

Attribute mlir::Operation::getAttr ( StringRef  name)
inline

Definition at line 372 of file Operation.h.

◆ getAttrDictionary()

DictionaryAttr mlir::Operation::getAttrDictionary ( )
inline

◆ getAttrOfType() [1/2]

template<typename AttrClass >
AttrClass mlir::Operation::getAttrOfType ( StringAttr  name)
inline

◆ getAttrOfType() [2/2]

template<typename AttrClass >
AttrClass mlir::Operation::getAttrOfType ( StringRef  name)
inline

Definition at line 379 of file Operation.h.

References mlir::Attribute::dyn_cast_or_null(), and getAttr().

◆ getAttrs()

ArrayRef<NamedAttribute> mlir::Operation::getAttrs ( )
inline

◆ getBlock()

Block* mlir::Operation::getBlock ( )
inline

Returns the operation block that contains this operation.

Definition at line 144 of file Operation.h.

Referenced by llvm::ilist_traits<::mlir::Operation >::addNodeToList(), mlir::detail::ConversionPatternRewriterImpl::applyRewrites(), mlir::computeTopologicalSorting(), constructTiledLoopNest(), mlir::createLoopFusionPass(), diagnoseInvalidOperandDominance(), erase(), mlir::Region::findAncestorBlockInRegion(), findAncestorOpInRegion(), findInstPosition(), forwardTerminatorOperands(), funcsToCoroutines(), mlir::generateCopyForMemRegion(), getCommonBlock(), getEnclosingforOps(), getPhiIncomingBlock(), mlir::bufferization::BufferPlacementAllocs::getStartOperation(), getZero(), hasAllocationScope(), hasNoInterveningEffect(), hoistAffineIfOp(), mlir::dataflow::DeadCodeAnalysis::initialize(), mlir::inlineRegion(), mlir::OperationFolder::insertKnownConstant(), mlir::sparse_tensor::isAdmissableBranch(), mlir::sparse_tensor::isAdmissableBranchExp(), mlir::Liveness::isDeadAfter(), mlir::isLegalForBranchOpInterfaceTypeConversionPattern(), mlir::isNotBranchOpInterfaceOrReturnLikeOp(), mlir::detail::DominanceInfoBase< true >::isReachableFromEntry(), isRegionOrCallableReturn(), mlir::Value::isUsedOutsideOfBlock(), lastNonTerminatorInRegion(), mlir::linalg::PadOpTransformationPattern::matchAndRewrite(), mayExistInterleavedUses(), mlir::RewriterBase::mergeBlockBefore(), moveAfter(), moveBefore(), mlir::OperationFolder::notifyRemoval(), mlir::bufferization::populateDynamicDimSizes(), printIR(), mlir::DominanceInfo::properlyDominates(), mlir::PostDominanceInfo::properlyPostDominates(), remove(), replaceIterArgs(), mlir::OpBuilder::setInsertionPoint(), mlir::OpBuilder::setInsertionPointAfter(), mlir::Block::splitBlock(), mlir::OperationFolder::tryToFold(), validateSupportedControlFlow(), mlir::OpTrait::impl::verifyIsTerminator(), verifyResultTypesAreInferrable(), mlir::dataflow::AbstractDenseDataFlowAnalysis::visit(), mlir::dataflow::AbstractSparseDataFlowAnalysis::visit(), and mlir::dataflow::DeadCodeAnalysis::visit().

◆ getBlockOperands()

MutableArrayRef<BlockOperand> mlir::Operation::getBlockOperands ( )
inline

◆ getContext()

MLIRContext* mlir::Operation::getContext ( )
inline

Return the context this operation is associated with.

Definition at line 147 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(), constructResultVector(), create(), diagnoseInvalidOperandDominance(), emitError(), emitRemark(), emitWarning(), generateLocationsFromIR(), getAssumedUniqueReturnOp(), mlir::getComputationSliceState(), mlir::Region::getContext(), getLibraryCallSymbolRef(), mlir::LLVM::detail::getLLVMConstant(), getLocalInvocationDimSize(), mlir::OpPassManager::getNesting(), getNeutralElement(), mlir::detail::PassCrashReproducerGenerator::initialize(), mlir::SymbolTable::insert(), mlir::bufferization::insertSliceAnchoredAllocTensorEliminationStep(), mlir::bufferization::insertTensorCopies(), mlir::SymbolTable::lookup(), mlir::SymbolTable::lookupSymbolIn(), mlir::spirv::lookupTargetEnvOrDefault(), matchAndReplaceDepthwiseConv(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), mlirLinalgFillBuiltinNamedOpRegion(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), populateDefaultAttrs(), mlir::linalg::populateElementwiseOpsFusionPatterns(), mlir::linalg::populateFoldUnitExtentDimsPatterns(), prepareLLVMModule(), removeAttr(), resolveUsesInRepetitiveRegions(), 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(), toUnsignedPred(), tryApply(), mlir::detail::verifyInferredResultTypes(), verifyOpAndAdjustFlags(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), and GpuAsyncRegionPass::DeferWaitCallback::~DeferWaitCallback().

◆ getDialect()

Dialect* mlir::Operation::getDialect ( )
inline

◆ getDialectAttrs()

dialect_attr_range mlir::Operation::getDialectAttrs ( )
inline

Return a range corresponding to the dialect attributes for this operation.

Definition at line 438 of file Operation.h.

References getAttrs().

Referenced by forwardPassthroughAttributes().

◆ getLoc()

Location mlir::Operation::getLoc ( )
inline

The source location the operation was defined or derived from.

Definition at line 154 of file Operation.h.

Referenced by addRuntimePreemptionSpecifier(), mlir::affineDataCopyGenerate(), mlir::AllocationOpLLVMLowering::allocateBufferAutoAlign(), mlir::bufferization::allocateTensorForShapedValue(), buildMultiDimReduce(), buildUnresolvedTargetMaterialization(), buildVectorComparison(), canonicalizeMinMaxOp(), checkDoubleConsume(), clone(), cloneAndFuseFirstUse(), collapseGenericOpIterationDims(), computeMemoryOpIndices(), containsReturn(), mlir::LLVM::ModuleTranslation::convertBlock(), convertElementwiseOp(), mlir::createAffineComputationSlice(), createConstFromIntAttribute(), createLinalgBodyCalculationForElementwiseOp(), createLinalgBodyCalculationForReduceOp(), createPrivateMemRef(), createSourceLocationInfo(), diagnoseInvalidOperandDominance(), elementwiseMatchAndRewriteHelper(), emitError(), emitRemark(), emitWarning(), mlir::detail::PassCrashReproducerGenerator::finalize(), findLiveUserOfReplaced(), forwardTerminatorOperands(), fuse(), getBlockIt(), mlir::transform::TransformState::getHandleForPayloadOp(), getLibraryCallSymbolRef(), mlir::Region::getLoc(), getMemoryFootprintBytes(), mlir::spirv::getMemorySpaceToStorageClassTarget(), mlir::getMemRefSizeInBytes(), getOrCreateOperandsMatchingResultTypes(), getOrInsertBuiltinVariable(), mlir::scf::getParallelForInductionVarOwner(), mlir::spirv::getPushConstantValue(), mlir::LLVM::detail::handleMultidimensionalVectors(), inlinePayload(), insertCasts(), interruptIfValidLocation(), mlir::OperationEquivalence::isEquivalentTo(), isFusionProfitable(), isMemRefNormalizable(), logFailure(), matchAndReplaceDepthwiseConv(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), mlir::ConversionPattern::matchAndRewrite(), mlirLinalgFillBuiltinNamedOpRegion(), mlir::RewriterBase::notifyMatchFailure(), mlir::LLVM::detail::oneToOneRewrite(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), prepareLLVMModule(), printConstantOp(), mlir::AsmPrinter::Impl::printIntegerSet(), printOperation(), reduceMatchAndRewriteHelper(), ReifyExpandOrCollapseShapeOp< OpTy >::reifyResultShapes(), mlir::replaceAllMemRefUsesWith(), mlir::bufferization::replaceOpWithNewBufferizedOp(), mlir::RewriterBase::replaceOpWithNewOp(), shouldPrintElementsAttrWithHex(), splatZero(), mlir::vector::splitFullAndPartialTransfer(), tileAndFuseFirstExtractUse(), tileAndFuseFirstExtractUseThroughContainingOpBlockArgument(), mlir::transform::tileToForeachThreadOpImpl(), mlir::OpBuilder::tryFold(), vectorizeOneOp(), mlir::LLVM::detail::vectorOneToOneRewrite(), mlir::detail::verifyDataLayoutOp(), mlir::detail::verifyInferredResultTypes(), mlir::OpTrait::impl::verifyIsIsolatedFromAbove(), verifyJointMatrixMad(), verifyRegionAttribute(), verifyResultTypesAreInferrable(), mlir::detail::verifySymbolTable(), widenOp(), wrapInExecuteRegion(), writeDialectGrouping(), and GpuAsyncRegionPass::DeferWaitCallback::~DeferWaitCallback().

◆ getName()

OperationName mlir::Operation::getName ( )
inline

The name of an operation is the key identifier for it.

Definition at line 50 of file Operation.h.

Referenced by mlir::linalg::LinalgTransformationFilter::addOpNameFilter(), AncestorKey::AncestorKey(), 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(), mlir::spirv::getMemorySpaceToStorageClassTarget(), 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(), 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(), mlir::transform::TransformEachOpTrait< OpTy >::verifyTrait(), mlir::transform::FunctionalStyleTransformOpTrait< OpTy >::verifyTrait(), mlir::transform::NavigationTransformOpTrait< OpTy >::verifyTrait(), visitInPrettyBlockOrder(), widenOp(), and writeDialectGrouping().

◆ getNumOperands()

unsigned mlir::Operation::getNumOperands ( )
inline

Definition at line 263 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(), forwardTerminatorOperands(), getAssumedUniqueReturnOp(), getOperandValuesImpl(), mlir::OperationFolder::getOrCreateConstant(), mlir::scf::insideMutuallyExclusiveBranches(), mlir::insideMutuallyExclusiveRegions(), isAddMul(), mlir::sparse_tensor::isAdmissableBranch(), mlir::sparse_tensor::isAdmissableBranchExp(), 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(), mlir::OpTrait::impl::verifyZeroOperands(), mlir::dataflow::AbstractSparseDataFlowAnalysis::visit(), mlir::dataflow::SparseConstantPropagation::visitOperation(), and writeDialectGrouping().

◆ getNumRegions()

unsigned mlir::Operation::getNumRegions ( )
inline

Returns the number of regions held by this operation.

Definition at line 477 of file Operation.h.

Referenced by canBeHoisted(), clone(), mlir::createLoopFusionPass(), diagnoseInvalidOperandDominance(), findOptimal(), getBackwardSliceImpl(), getLspDiagnoticFromDiag(), mlir::OperationEquivalence::isEquivalentTo(), isPotentiallyUnknownSymbolTable(), isRegionOrCallableReturn(), 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::detail::verifyParallelCombiningOpInterface(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait(), mlir::detail::verifySymbolTable(), mlir::OpTrait::SingleBlock< ConcreteType >::verifyTrait(), mlir::detail::verifyTypesAlongControlFlowEdges(), mlir::OpTrait::impl::verifyZeroRegions(), mlir::dataflow::DeadCodeAnalysis::visit(), mlir::dataflow::SparseConstantPropagation::visitOperation(), wrapInExecuteRegion(), and writeDialectGrouping().

◆ getNumResults()

unsigned mlir::Operation::getNumResults ( )
inline

Return the number of results held by this operation.

Definition at line 321 of file Operation.h.

Referenced by analyzeProfitability(), clone(), mlir::detail::Parser::codeCompleteDialectSymbol(), convertOperationImpl(), elementwiseMatchAndRewriteHelper(), mlir::ConversionPatternRewriter::eraseOp(), executeGetOperandsResults(), mlir::linalg::generateLibraryCallName(), getEnclosingforOps(), getLibraryCallSymbolRef(), mlir::OperationFolder::getOrCreateConstant(), getUsers(), getZero(), 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::transform::tileToForeachThreadOpImpl(), mlir::OpTrait::impl::verifyAtLeastNResults(), mlir::linalg::detail::verifyDestinationStyleOpInterface(), mlir::OpTrait::impl::verifyElementwise(), mlir::OpTrait::impl::verifyNResults(), mlir::OpTrait::impl::verifyOneResult(), mlir::OpTrait::impl::verifyResultSizeAttr(), verifyShapeOrExtentTensorOp(), verifySizeOrIndexOp(), mlir::OpTrait::impl::verifyZeroResults(), mlir::dataflow::AbstractSparseDataFlowAnalysis::visit(), mlir::dataflow::SparseConstantPropagation::visitOperation(), walkReferenceCountedValues(), and writeDialectGrouping().

◆ getNumSuccessors()

unsigned mlir::Operation::getNumSuccessors ( )
inline

◆ getOperand()

Value mlir::Operation::getOperand ( unsigned  idx)
inline

◆ getOperands()

operand_range mlir::Operation::getOperands ( )
inline

Returns an iterator on the underlying Value's.

Definition at line 295 of file Operation.h.

References getOpOperands().

Referenced by bindShapeDims(), canBeHoisted(), clone(), mlir::Region::cloneInto(), mlir::OperationEquivalence::computeHash(), convertElementwiseOp(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertStructType(), mlir::createAffineComputationSlice(), defaultIsSmallAlloc(), dependsOnCarriedVals(), diagnoseInvalidOperandDominance(), eachHasOnlyOneOfTypes(), elementwiseMatchAndRewriteHelper(), extractBeneficiaryOps(), mlir::impl::foldCastInterfaceOp(), forwardTerminatorOperands(), getBackwardSliceImpl(), getOperandTypes(), getOperandValuesImpl(), getOrCreateOperandsMatchingResultTypes(), getOutermostInvariantForOp(), mlir::scf::getParallelForInductionVarOwner(), mlir::linalg::getUpperBoundForIndex(), hasAllocationScope(), hasNonAffineUsersOnThePath(), inlineConvertOmpRegions(), inlinePayload(), insertCasts(), mlir::OperationEquivalence::isEquivalentTo(), isMemRefNormalizable(), isOpReady(), SortCommutativeOperands::matchAndRewrite(), mlir::ConversionPattern::matchAndRewrite(), AllocaScopeInliner::matchAndRewrite(), AllocaScopeHoister::matchAndRewrite(), matchSimpleReduction(), mayBeValidWithoutTerminator(), operand_begin(), operand_end(), mlir::MutableOperandRange::operator OperandRange(), GpuAsyncRegionPass::ThreadTokenCallback::operator()(), mlir::outlineSingleBlockRegion(), CommutativeOperand::popFrontAndPushAdjacentUnvisitedAncestors(), printAtomicUpdateOp(), mlir::OpAsmPrinter::printFunctionalType(), mlir::AsmPrinter::Impl::printIntegerSet(), printNVVMIntrinsicOp(), printOneResultOp(), printOperation(), mlir::replaceAllMemRefUsesWith(), mlir::replaceForOpWithNewYields(), replaceOpWithRegion(), mlir::scf::TileConsumerAndFuseProducersUsingSCFForOp::returningMatchAndRewrite(), mlir::sparse_tensor::BufferizeDenseOpsPass::runOnOperation(), sourceMaterializationCallback(), splatZero(), staticallyNonNegative(), vectorizeOneOp(), mlir::detail::verifyInferredResultTypes(), verifyJointMatrixMad(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), mlir::OpTrait::impl::verifySameOperandsElementType(), mlir::dataflow::AbstractSparseDataFlowAnalysis::visit(), visitInPrettyBlockOrder(), mlir::dataflow::IntegerRangeAnalysis::visitNonControlFlowArguments(), mlir::dataflow::SparseConstantPropagation::visitOperation(), widenOp(), and writeDialectGrouping().

◆ getOperandTypes()

operand_type_range mlir::Operation::getOperandTypes ( )
inline

◆ getOpOperand()

OpOperand& mlir::Operation::getOpOperand ( unsigned  idx)
inline

◆ getOpOperands()

MutableArrayRef<OpOperand> mlir::Operation::getOpOperands ( )
inline

◆ getOpResult()

OpResult mlir::Operation::getOpResult ( unsigned  idx)
inline

Definition at line 338 of file Operation.h.

References getResult().

Referenced by applyTilingToAll(), and cloneAndFuseFirstUse().

◆ getOpResults()

result_range mlir::Operation::getOpResults ( )
inline

◆ getParentOfType()

template<typename OpTy >
OpTy mlir::Operation::getParentOfType ( )
inline

◆ getParentOp()

Operation* mlir::Operation::getParentOp ( )
inline

Returns the closest surrounding operation that contains this operation or nullptr if this is a top-level operation.

Definition at line 165 of file Operation.h.

References getParentOp().

Referenced by assertDestinationPassingStyle(), mlir::DataLayout::closest(), collectParentLayouts(), collectSymbolScopes(), collectValidReferencesFor(), mlir::DataLayoutAnalysis::DataLayoutAnalysis(), declareReduction(), 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::getEnclosingAffineOps(), mlir::getEnclosingRepetitiveRegion(), 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(), isRegionOrCallableReturn(), mlir::isTopLevelValue(), mlir::spirv::lookupEntryPointABI(), mlir::spirv::lookupTargetEnv(), AllocaScopeHoister::matchAndRewrite(), mlir::matchReduction(), mlir::AnalysisManager::nest(), parentLLVMModule(), mlir::detail::PassCrashReproducerGenerator::prepareReproducerFor(), mlir::CallGraph::print(), print(), mlir::Block::print(), printAtomicReductionRegion(), printOperation(), mlir::SymbolTable::remove(), mlir::SymbolUserMap::replaceAllUsesWith(), vectorizeConstant(), verifyHasBindingUse(), verifySymbolAttribute(), mlir::OpTrait::HasParent< ParentOpTypes >::Impl< ConcreteType >::verifyTrait(), visit(), mlir::dataflow::DeadCodeAnalysis::visit(), and walkReferencedSymbolNodes().

◆ getParentRegion()

Region* mlir::Operation::getParentRegion ( )
inline

◆ getParentWithTrait()

template<template< typename T > class Trait>
Operation* mlir::Operation::getParentWithTrait ( )
inline

Returns the closest surrounding parent operation with trait Trait.

Definition at line 179 of file Operation.h.

References getParentOp(), hasTrait(), and isProperAncestor().

Referenced by forwardTerminatorOperands(), getAllocEffectFor(), getDumpRootOp(), and mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait().

◆ getRegion()

Region& mlir::Operation::getRegion ( unsigned  index)
inline

◆ getRegions()

MutableArrayRef<Region> mlir::Operation::getRegions ( )
inline

Returns the regions held by this operation.

Definition at line 480 of file Operation.h.

Referenced by mlir::applyPatternsAndFoldGreedily(), mlir::bufferization::BufferizationAliasInfo::BufferizationAliasInfo(), buildUnresolvedTargetMaterialization(), mlir::OpBuilder::clone(), mlir::Region::cloneInto(), mlir::detail::Parser::codeCompleteDialectSymbol(), collectCallOps(), computeCallGraph(), create(), detachNestedAndErase(), dfsPostorder(), diagnoseInvalidOperandDominance(), dropAllDefinedValueUses(), dropAllReferences(), mlir::LLVM::ensureDistinctSuccessors(), findOptimal(), getForwardSliceImpl(), mlir::getInnermostParallelLoops(), getLspDiagnoticFromDiag(), mlir::spirv::getMemorySpaceToStorageClassTarget(), getRegion(), mlir::Region::getRegionNumber(), mlir::dataflow::AbstractDenseDataFlowAnalysis::initialize(), mlir::dataflow::AbstractSparseDataFlowAnalysis::initialize(), mlir::dataflow::DeadCodeAnalysis::initialize(), mlir::bytecode::detail::IRNumberingState::IRNumberingState(), isMemRefNormalizable(), isRegionOrCallableReturn(), 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(), walkSymbolTable(), mlir::SymbolTable::walkSymbolTables(), walkSymbolUses(), wouldOpBeTriviallyDeadImpl(), wrapInExecuteRegion(), and writeDialectGrouping().

◆ getRegisteredInfo()

Optional<RegisteredOperationName> mlir::Operation::getRegisteredInfo ( )
inline

◆ getResult()

OpResult mlir::Operation::getResult ( unsigned  idx)
inline

Get the 'idx'th result of this operation.

Definition at line 324 of file Operation.h.

Referenced by addRuntimePreemptionSpecifier(), mlir::affineParallelize(), analyzeProfitability(), mlir::Op< AffineDmaStartOp, OpTrait::MemRefsNormalizable, OpTrait::VariadicOperands, OpTrait::ZeroResults, OpTrait::OpInvariants, AffineMapAccessInterface::Trait >::attachInterface(), mlir::bufferization::func_ext::CallOpInterface::bufferize(), buildVectorWrite(), clone(), mlir::detail::Parser::codeCompleteDialectSymbol(), mlir::spirv::Deserializer::collect(), convertElementwiseOp(), convertOmpThreadprivate(), convertOperationImpl(), createLinalgBodyCalculationForElementwiseOp(), mlir::spirv::Deserializer::processOp< spirv::GenericCastToPtrExplicitOp >(), elementwiseMatchAndRewriteHelper(), executeGetOperandsResults(), extractOpcode(), foldInsertAfterExtractSlice(), mlir::op_definition_impl::foldTrait(), mlir::linalg::TileLoopNest::fuseProducer(), mlir::linalg::generateLibraryCallName(), genForInduction(), getCollapsedOpOperand(), getEnclosingforOps(), getLLVMAtomicOrdering(), getLspDiagnoticFromDiag(), mlir::AllocationOpLLVMLowering::getMemRefResultType(), getNeutralElement(), getOpResult(), mlir::OperationFolder::getOrCreateConstant(), mlir::nvgpu::getWarpMatrixInfo(), mlir::LLVM::detail::handleMultidimensionalVectors(), inlinePayload(), mlir::bufferization::insertSliceAnchoredAllocTensorEliminationStep(), isMemRefNormalizable(), isZeroYield(), 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(), mlir::scf::TileUsingSCFForOp::returningMatchAndRewrite(), splatZero(), mlir::RewriterBase::splitBlock(), mlir::linalg::splitReduction(), mlir::linalg::splitReductionByScaling(), tileAndFuseFirstExtractUse(), tileAndFuseFirstExtractUseThroughContainingOpBlockArgument(), mlir::transform::tileToForeachThreadOpImpl(), mlir::OperationFolder::tryToFold(), vectorizeOperand(), verifyCastOp(), verifyJointMatrixMad(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), verifyShiftOp(), and walkReferenceCountedValues().

◆ getResults()

result_range mlir::Operation::getResults ( )
inline

Definition at line 332 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(), foldInsertAfterExtractSlice(), forwardTerminatorOperands(), mlir::linalg::generateLibraryCallName(), getAsValue(), getForwardSliceImpl(), getLastDependentOpInRange(), getLspDiagnoticFromDiag(), mlir::spirv::getMemorySpaceToStorageClassTarget(), getOpResults(), getResultTypes(), mlir::linalg::getUpperBoundForIndex(), getUses(), getZero(), invertCollapseShapeIndexing(), mlir::linalg::ExtractSliceOfPadTensorSwapPattern::matchAndRewrite(), mfmaOpToIntrinsic(), mlir::detail::ConversionPatternRewriterImpl::notifyOpReplaced(), peelLoop(), mlir::vector::populateWarpExecuteOnLane0OpToScfForPattern(), 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::scf::TileUsingSCFForOp::returningMatchAndRewrite(), mlir::sparse_tensor::BufferizeDenseOpsPass::runOnOperation(), mlir::sinkOperationsIntoLaunchOp(), mlir::RewriterBase::splitBlock(), staticallyNonNegative(), mlir::OpBuilder::tryFold(), use_begin(), use_empty(), use_end(), validateSupportedControlFlow(), vectorizeAsLinalgGeneric(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), mlir::dataflow::AbstractSparseDataFlowAnalysis::visit(), mlir::dataflow::IntegerRangeAnalysis::visitOperation(), widenOp(), and wrapInExecuteRegion().

◆ getResultTypes()

result_type_range mlir::Operation::getResultTypes ( )
inline

◆ getSuccessor()

Block* mlir::Operation::getSuccessor ( unsigned  index)
inline

◆ getSuccessors()

SuccessorRange mlir::Operation::getSuccessors ( )
inline

◆ getUsers()

user_range mlir::Operation::getUsers ( )
inline

◆ getUses()

use_range mlir::Operation::getUses ( )
inline

Returns a range of all uses, which is useful for iterating over all uses.

Definition at line 623 of file Operation.h.

References getResults(), and mlir::ResultRange::getUses().

Referenced by mlir::bufferization::bufferizeOp(), hasOneUse(), and replaceUsesAndPropagateType().

◆ hasAttr() [1/2]

bool mlir::Operation::hasAttr ( StringAttr  name)
inline

Return true if the operation has an attribute with the provided name, false otherwise.

Definition at line 385 of file Operation.h.

Referenced by getAssumedUniqueReturnOp(), mlir::bufferization::insertTensorCopies(), and mlir::bufferization::shouldDeallocateOpResult().

◆ hasAttr() [2/2]

bool mlir::Operation::hasAttr ( StringRef  name)
inline

Definition at line 386 of file Operation.h.

◆ hasAttrOfType()

template<typename AttrClass , typename NameT >
bool mlir::Operation::hasAttrOfType ( NameT &&  name)
inline

Definition at line 388 of file Operation.h.

◆ hasOneUse()

bool mlir::Operation::hasOneUse ( )
inline

Returns true if this operation has exactly one use.

Definition at line 626 of file Operation.h.

References getUses().

Referenced by mlir::matchReduction(), and mlir::linalg::populateElementwiseOpsFusionPatterns().

◆ hasSuccessors()

bool mlir::Operation::hasSuccessors ( )
inline

Definition at line 505 of file Operation.h.

◆ hasTrait()

template<template< typename T > class Trait>
bool mlir::Operation::hasTrait ( )
inline

Returns true if the operation was registered with a particular trait, e.g.

hasTrait<OperandsAreSignlessIntegerLike>().

Definition at line 528 of file Operation.h.

References mlir::OperationName::hasTrait().

Referenced by AncestorKey::AncestorKey(), 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::bytecode::detail::IRNumberingState::IRNumberingState(), 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(), SortCommutativeOperands::matchAndRewrite(), AllocaScopeHoister::matchAndRewrite(), mayBeValidWithoutTerminator(), mlirBlockGetTerminator(), print(), propagateLiveness(), remainsLegalAfterInline(), mlir::LLVM::satisfiesLLVMModule(), shouldPrintElementsAttrWithHex(), mlir::sortTopologically(), mlir::SymbolTable::SymbolTable(), mlir::transform::tileToForeachThreadOpImpl(), mlir::OpTrait::impl::verifyIsIsolatedFromAbove(), verifyJointMatrixMad(), mlir::dataflow::IntegerRangeAnalysis::visitNonControlFlowArguments(), mlir::dataflow::IntegerRangeAnalysis::visitOperation(), walkSymbolTable(), mlir::SymbolTable::walkSymbolTables(), walkSymbolUses(), wouldOpBeTriviallyDeadImpl(), and writeDialectGrouping().

◆ insertOperands()

void Operation::insertOperands ( unsigned  index,
ValueRange  operands 
)

Insert the given operands into the operand list at the given 'index'.

Definition at line 213 of file Operation.cpp.

References setOperands().

Referenced by mlir::gpu::addAsyncDependency(), addExecuteResults(), mlir::MutableOperandRange::append(), and replaceAllUsesWith().

◆ isAncestor()

bool mlir::Operation::isAncestor ( Operation other)
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 194 of file Operation.h.

References isProperAncestor(), and replaceUsesOfWith().

Referenced by canBeHoisted(), cloneAndFuseFirstUse(), collectValidReferencesFor(), dependsOnCarriedVals(), mlir::OpPassManager::getNesting(), hasNoInterveningEffect(), and mlir::dataflow::DeadCodeAnalysis::visit().

◆ isBeforeInBlock()

bool Operation::isBeforeInBlock ( Operation other)

◆ isProperAncestor()

bool Operation::isProperAncestor ( Operation other)

◆ isRegistered()

bool mlir::Operation::isRegistered ( )
inline

Returns true if this operation has a registered operation description, otherwise false.

Definition at line 60 of file Operation.h.

References erase(), getName(), and mlir::OperationName::isRegistered().

◆ isUsedOutsideOfBlock()

bool mlir::Operation::isUsedOutsideOfBlock ( Block block)
inline

Returns true if the results of this operation are used outside of the given block.

Definition at line 633 of file Operation.h.

References getOpResults(), and mlir::Value::isUsedOutsideOfBlock().

◆ mightHaveTrait()

template<template< typename T > class Trait>
bool mlir::Operation::mightHaveTrait ( )
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 536 of file Operation.h.

References mlir::OperationName::mightHaveTrait(), and mlir::PostOrder.

Referenced by create(), ensureDistinctSuccessors(), mlir::isNotBranchOpInterfaceOrReturnLikeOp(), isTerminator(), mlir::matchReduction(), mayBeValidWithoutTerminator(), and mlir::wouldOpBeTriviallyDead().

◆ moveAfter() [1/2]

void Operation::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.

Definition at line 448 of file Operation.cpp.

References getBlock().

Referenced by replaceAllUsesWith(), and validateSupportedControlFlow().

◆ moveAfter() [2/2]

void Operation::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.

Definition at line 454 of file Operation.cpp.

References mlir::Block::end(), and moveBefore().

◆ moveBefore() [1/2]

void Operation::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.

Definition at line 434 of file Operation.cpp.

References getBlock().

Referenced by checkInvarianceOfNestedIfOps(), hasAllocationScope(), mlir::OperationFolder::insertKnownConstant(), moveAfter(), mlir::vector::populateWarpExecuteOnLane0OpToScfForPattern(), replaceAllUsesWith(), mlir::sortTopologically(), and mlir::OperationFolder::tryToFold().

◆ moveBefore() [2/2]

void Operation::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.

Unlink this operation from its current basic block and insert it right before iterator in the specified basic block.

Definition at line 440 of file Operation.cpp.

References getBlock(), and mlir::Block::getOperations().

◆ operand_begin()

operand_iterator mlir::Operation::operand_begin ( )
inline

◆ operand_end()

operand_iterator mlir::Operation::operand_end ( )
inline

◆ operand_type_begin()

operand_type_iterator mlir::Operation::operand_type_begin ( )
inline

◆ operand_type_end()

operand_type_iterator mlir::Operation::operand_type_end ( )
inline

Definition at line 313 of file Operation.h.

References operand_end().

Referenced by checkAndUpdateCapabilityRequirements(), and mlir::SPIRVConversionTarget::get().

◆ populateDefaultAttrs()

void mlir::Operation::populateDefaultAttrs ( )
inline

Sets default attributes on unset attributes.

Definition at line 464 of file Operation.h.

References getAttrDictionary(), getContext(), mlir::NamedAttrList::getDictionary(), getRegisteredInfo(), and setAttrs().

◆ print() [1/2]

void Operation::print ( raw_ostream &  os,
const OpPrintingFlags flags = llvm::None 
)

◆ print() [2/2]

void Operation::print ( raw_ostream &  os,
AsmState state 
)

◆ remove()

void Operation::remove ( )

Remove the operation from its parent block, but don't delete it.

Definition at line 426 of file Operation.cpp.

References getBlock().

Referenced by mlir::lsp::MLIRServer::convertFromBytecode().

◆ removeAttr() [1/2]

Attribute mlir::Operation::removeAttr ( StringAttr  name)
inline

◆ removeAttr() [2/2]

Attribute mlir::Operation::removeAttr ( StringRef  name)
inline

Definition at line 414 of file Operation.h.

References getContext(), and removeAttr().

◆ replaceAllUsesWith()

template<typename ValuesT >
void mlir::Operation::replaceAllUsesWith ( ValuesT &&  values)
inline

◆ replaceUsesOfWith()

void Operation::replaceUsesOfWith ( Value  from,
Value  to 
)

Replace any uses of 'from' with 'to' within this operation.

Definition at line 184 of file Operation.cpp.

References getOpOperands().

Referenced by mlir::inlineCall(), and isAncestor().

◆ result_begin()

result_iterator mlir::Operation::result_begin ( )
inline

Definition at line 330 of file Operation.h.

References getResults().

Referenced by mlir::OperationFolder::create(), and mlir::linalg::generateLibraryCallName().

◆ result_end()

result_iterator mlir::Operation::result_end ( )
inline

Definition at line 331 of file Operation.h.

References getResults().

Referenced by mlir::OperationFolder::create(), and mlir::linalg::generateLibraryCallName().

◆ result_type_begin()

result_type_iterator mlir::Operation::result_type_begin ( )
inline

◆ result_type_end()

result_type_iterator mlir::Operation::result_type_end ( )
inline

◆ setAttr() [1/2]

void mlir::Operation::setAttr ( StringAttr  name,
Attribute  value 
)
inline

◆ setAttr() [2/2]

void mlir::Operation::setAttr ( StringRef  name,
Attribute  value 
)
inline

Definition at line 400 of file Operation.h.

References getContext(), and setAttr().

◆ setAttrs() [1/2]

void mlir::Operation::setAttrs ( DictionaryAttr  newAttrs)
inline

◆ setAttrs() [2/2]

void mlir::Operation::setAttrs ( ArrayRef< NamedAttribute newAttrs)
inline

Definition at line 366 of file Operation.h.

References getContext(), and setAttrs().

◆ setDialectAttrs()

template<typename DialectAttrT >
void mlir::Operation::setDialectAttrs ( DialectAttrT &&  dialectAttrs)
inline

Set the dialect attributes for this operation, and preserve all dependent.

Definition at line 454 of file Operation.h.

References mlir::NamedAttrList::append(), getAttrs(), getContext(), mlir::NamedAttrList::getDictionary(), mlir::NamedAttrList::push_back(), and setAttrs().

◆ setLoc()

void mlir::Operation::setLoc ( Location  loc)
inline

Set the source location the operation was defined or derived from.

Definition at line 157 of file Operation.h.

Referenced by generateLocationsFromIR(), and logFailure().

◆ setOperand()

void mlir::Operation::setOperand ( unsigned  idx,
Value  value 
)
inline

◆ setOperands() [1/2]

void Operation::setOperands ( ValueRange  operands)

◆ setOperands() [2/2]

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 203 of file Operation.cpp.

References getNumOperands(), and mlir::detail::OperandStorage::setOperands().

◆ setSuccessor()

void Operation::setSuccessor ( Block block,
unsigned  index 
)

Definition at line 484 of file Operation.cpp.

References getBlockOperands(), and getNumSuccessors().

Referenced by getSuccessor(), logFailure(), and walkReferenceCountedValues().

◆ successor_begin()

succ_iterator mlir::Operation::successor_begin ( )
inline

Definition at line 501 of file Operation.h.

References getSuccessors().

Referenced by logFailure().

◆ successor_end()

succ_iterator mlir::Operation::successor_end ( )
inline

Definition at line 502 of file Operation.h.

References getSuccessors().

Referenced by logFailure().

◆ use_begin()

use_iterator mlir::Operation::use_begin ( )
inline

Definition at line 619 of file Operation.h.

References getResults(), and mlir::ResultRange::use_begin().

Referenced by user_begin().

◆ use_empty()

bool mlir::Operation::use_empty ( )
inline

◆ use_end()

use_iterator mlir::Operation::use_end ( )
inline

Definition at line 620 of file Operation.h.

References getResults(), and mlir::ResultRange::use_end().

Referenced by user_end().

◆ user_begin()

user_iterator mlir::Operation::user_begin ( )
inline

Definition at line 646 of file Operation.h.

References use_begin().

Referenced by getUsers().

◆ user_end()

user_iterator mlir::Operation::user_end ( )
inline

Definition at line 647 of file Operation.h.

References use_end().

Referenced by getUsers().

◆ walk() [1/2]

template<WalkOrder Order = WalkOrder::PostOrder, typename FnT , typename RetT = detail::walkResultType<FnT>>
std::enable_if_t<llvm::function_traits<std::decay_t<FnT> >::num_args == 1, RetT> mlir::Operation::walk ( FnT &&  callback)
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 walk is in post-order, or
  • the walk is in pre-order and the walk is skipped after the erasure.

The callback method can take any of the following forms: void(Operation*) : Walk all operations opaquely.

  • op->walk([](Operation nestedOp) { ...}); void(OpT) : Walk all operations of the given derived type.
  • op->walk([](ReturnOp returnOp) { ...}); WalkResult(Operation|OpT) : Walk operations, but allow for interruption/skipping.
  • op->walk([](... op) { // Skip the walk of this op based on some invariant. if (some_invariant) return WalkResult::skip(); // Interrupt, i.e cancel, the walk based on some invariant. if (another_invariant) return WalkResult::interrupt(); return WalkResult::advance(); });

Definition at line 574 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::createLoopFusionPass(), mlir::DataLayoutAnalysis::DataLayoutAnalysis(), mlir::bufferization::deallocateBuffers(), mlir::LLVM::detail::DebugTranslation::DebugTranslation(), doubleBuffer(), mlir::bufferization::eliminateAllocTensors(), mlir::LLVM::ensureDistinctSuccessors(), equivalenceAnalysis(), mlir::finalizeParallelLoopToGPUConversion(), mlir::linalg::findTopLevelForeachThreadOp(), mlir::bufferization::OneShotAnalysisState::gatherUndefinedTensorUses(), mlir::bufferization::OneShotAnalysisState::gatherYieldedTensors(), generateLocationsFromIR(), getFirstDependentOpInRange(), getLastDependentOpInRange(), getLoadAndStoreMemRefAccesses(), getOpToConvert(), getShmReadAndWriteOps(), hasNonAffineUsersOnThePath(), mlir::dataflow::DeadCodeAnalysis::initialize(), inPlaceAnalysis(), mlir::bufferization::insertTensorCopies(), isOpReady(), mlir::detail::ConversionPatternRewriterImpl::markNestedOpsIgnored(), mlir::NestedPattern::match(), mlir::bufferization::OneShotAnalysisState::OneShotAnalysisState(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), mlir::Liveness::print(), mlir::BufferViewFlowAnalysis::remove(), resolveUsesInRepetitiveRegions(), mlir::linalg::rewriteMapNestedForeachThreadToGpuThreads(), mlir::vector::transferOpflowOpt(), validateSupportedControlFlow(), and walkReferenceCountedValues().

◆ walk() [2/2]

template<typename FnT , typename RetT = detail::walkResultType<FnT>>
std::enable_if_t<llvm::function_traits<std::decay_t<FnT> >::num_args == 2, RetT> mlir::Operation::walk ( FnT &&  callback)
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 602 of file Operation.h.

References mlir::detail::walk().

Friends And Related Function Documentation

◆ Block

friend class Block
friend

Definition at line 784 of file Operation.h.

◆ llvm::ilist_node_with_parent< Operation, Block >

friend class llvm::ilist_node_with_parent< Operation, Block >
friend

Definition at line 790 of file Operation.h.

◆ llvm::ilist_traits< Operation >

friend struct llvm::ilist_traits< Operation >
friend

Definition at line 781 of file Operation.h.

◆ Value

friend class Value
friend

Definition at line 787 of file Operation.h.


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