My Project
|
#include <Operation.h>
Classes | |
class | dialect_attr_iterator |
A utility iterator that filters out non-dialect attributes. More... | |
Public Member Functions | |
OperationName | getName () |
The name of an operation is the key identifier for it. More... | |
const AbstractOperation * | getAbstractOperation () |
bool | isRegistered () |
void | erase () |
Remove this operation from its parent block and delete it. More... | |
Operation * | clone (BlockAndValueMapping &mapper) |
Operation * | clone () |
Operation * | cloneWithoutRegions (BlockAndValueMapping &mapper) |
Operation * | cloneWithoutRegions () |
Block * | getBlock () |
Returns the operation block that contains this operation. More... | |
MLIRContext * | getContext () |
Return the context this operation is associated with. More... | |
Dialect * | getDialect () |
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 () |
Operation * | getParentOp () |
template<typename OpTy > | |
OpTy | getParentOfType () |
Return the closest surrounding parent operation that is of type 'OpTy'. More... | |
bool | isProperAncestor (Operation *other) |
bool | isAncestor (Operation *other) |
void | replaceUsesOfWith (Value from, Value to) |
Replace any uses of 'from' with 'to' within this operation. More... | |
template<typename ValuesT , typename = decltype(std::declval<ValuesT>().begin())> | |
void | replaceAllUsesWith (ValuesT &&values) |
Replace all uses of results of this operation with the provided 'values'. More... | |
void | replaceAllUsesWith (Operation *op) |
Replace all uses of results of this operation with results of 'op'. More... | |
void | destroy () |
Destroys this operation and its subclass data. More... | |
void | dropAllReferences () |
void | dropAllDefinedValueUses () |
Drop uses of all values defined by this operation or its nested regions. More... | |
void | moveBefore (Operation *existingOp) |
void | moveBefore (Block *block, llvm::iplist< Operation >::iterator iterator) |
bool | isBeforeInBlock (Operation *other) |
void | print (raw_ostream &os, OpPrintingFlags flags=llvm::None) |
void | dump () |
bool | hasResizableOperandsList () |
void | setOperands (ValueRange operands) |
unsigned | getNumOperands () |
Value | getOperand (unsigned idx) |
void | setOperand (unsigned idx, Value value) |
operand_iterator | operand_begin () |
operand_iterator | operand_end () |
operand_range | getOperands () |
Returns an iterator on the underlying Value's (Value ). More... | |
void | eraseOperand (unsigned idx) |
Erase the operand at position idx . 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... | |
NamedAttributeList & | getAttrList () |
Return the internal attribute list on this operation. More... | |
void | setAttrs (NamedAttributeList newAttrs) |
Attribute | getAttr (Identifier name) |
Return the specified attribute if present, null otherwise. More... | |
Attribute | getAttr (StringRef name) |
template<typename AttrClass > | |
AttrClass | getAttrOfType (Identifier name) |
template<typename AttrClass > | |
AttrClass | getAttrOfType (StringRef name) |
void | setAttr (Identifier name, Attribute value) |
void | setAttr (StringRef name, Attribute value) |
NamedAttributeList::RemoveResult | removeAttr (Identifier 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 () |
operand_range | getNonSuccessorOperands () |
Return the operands of this operation that are not successor arguments. More... | |
operand_range | getSuccessorOperands (unsigned index) |
Value | getSuccessorOperand (unsigned succIndex, unsigned opIndex) |
bool | hasSuccessors () |
unsigned | getNumSuccessors () |
unsigned | getNumSuccessorOperands (unsigned index) |
Block * | getSuccessor (unsigned index) |
void | setSuccessor (Block *block, unsigned index) |
void | eraseSuccessorOperand (unsigned succIndex, unsigned opIndex) |
unsigned | getSuccessorOperandIndex (unsigned index) |
Optional< std::pair< unsigned, unsigned > > | decomposeSuccessorOperandIndex (unsigned operandIndex) |
Optional< BlockArgument > | getSuccessorBlockArgument (unsigned operandIndex) |
bool | isCommutative () |
Returns whether the operation is commutative. More... | |
bool | hasNoSideEffect () |
Returns whether the operation has side-effects. More... | |
TerminatorStatus | getTerminatorStatus () |
Returns the status of whether this operation is a terminator or not. More... | |
bool | isKnownTerminator () |
Returns if the operation is known to be a terminator. More... | |
bool | isKnownNonTerminator () |
Returns if the operation is known to not be a terminator. More... | |
bool | isKnownIsolatedFromAbove () |
LogicalResult | fold (ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results) |
Attempt to fold this operation using the Op's registered foldHook. More... | |
template<template< typename T > class Trait> | |
bool | hasTrait () |
template<typename FnT , typename RetT = detail::walkResultType<FnT>> | |
RetT | walk (FnT &&callback) |
InFlightDiagnostic | emitOpError (const Twine &message={}) |
InFlightDiagnostic | emitError (const Twine &message={}) |
InFlightDiagnostic | emitWarning (const Twine &message={}) |
InFlightDiagnostic | emitRemark (const Twine &message={}) |
![]() | |
void | dropAllUses (ValueType value) |
Drop all uses of value from their respective owners. More... | |
void | replaceAllUsesWith (ValueType oldValue, ValueType newValue) |
filtered_use_iterator | use_begin (ValueType value) const |
filtered_use_iterator | use_end (ValueType) const |
filtered_use_range | getUses (ValueType value) const |
bool | hasOneUse (ValueType value) const |
bool | use_empty (ValueType value) const |
filtered_user_iterator | user_begin (ValueType value) const |
filtered_user_iterator | user_end (ValueType value) const |
filtered_user_range | getUsers (ValueType value) const |
![]() | |
~IRObjectWithUseList () | |
void | dropAllUses () |
Drop all uses of this object from their respective owners. More... | |
void | replaceAllUsesWith (typename OpOperand ::ValueType newValue) |
use_iterator | use_begin () const |
use_iterator | use_end () const |
use_range | getUses () const |
Returns a range of all uses, which is useful for iterating over all uses. More... | |
bool | hasOneUse () const |
Returns true if this value has exactly one use. More... | |
bool | use_empty () const |
Returns true if this value has no uses. More... | |
user_iterator | user_begin () const |
user_iterator | user_end () const |
user_range | getUsers () const |
Returns a range of all users. More... | |
Static Public Member Functions | |
static Operation * | create (Location location, OperationName name, ArrayRef< Type > resultTypes, ArrayRef< Value > operands, ArrayRef< NamedAttribute > attributes, ArrayRef< Block *> successors, unsigned numRegions, bool resizableOperandList) |
Create a new Operation with the specific fields. More... | |
static Operation * | create (Location location, OperationName name, ArrayRef< Type > resultTypes, ArrayRef< Value > operands, NamedAttributeList attributes, ArrayRef< Block *> successors, unsigned numRegions, bool resizableOperandList) |
static Operation * | create (const OperationState &state) |
Create a new Operation from the fields stored in state . More... | |
static Operation * | create (Location location, OperationName name, ArrayRef< Type > resultTypes, ArrayRef< Value > operands, NamedAttributeList attributes, ArrayRef< Block *> successors={}, RegionRange regions={}, bool resizableOperandList=false) |
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 > |
Additional Inherited Members | |
![]() | |
IRObjectWithUseList () | |
OpOperand * | getFirstUse () const |
Operation is a basic unit of execution within a function. Operations can be nested within other operations effectively forming a tree. Child operations are organized into operation blocks represented by a 'Block' class.
using mlir::Operation::operand_iterator = operand_range::iterator |
using mlir::Operation::result_iterator = result_range::iterator |
Support result iteration.
Support result type iteration.
using mlir::Operation::succ_iterator = SuccessorRange::iterator |
|
strong |
Operation * Operation::clone | ( | BlockAndValueMapping & | mapper | ) |
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.
Operation * Operation::clone | ( | ) |
Operation * Operation::cloneWithoutRegions | ( | BlockAndValueMapping & | mapper | ) |
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. Operands are remapped using mapper
(if present), and mapper
is updated to contain the results.
Create a deep copy of this operation but keep the operation regions empty. Operands are remapped using mapper
(if present), and mapper
is updated to contain the results.
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.
|
static |
Create a new Operation with the specific fields.
|
static |
Overload of create that takes an existing NamedAttributeList to avoid unnecessarily uniquing a list of attributes.
|
static |
|
static |
Create a new Operation with the specific fields.
Optional< std::pair< unsigned, unsigned > > Operation::decomposeSuccessorOperandIndex | ( | unsigned | operandIndex | ) |
Return a pair (successorIndex, successorArgIndex) containing the index of the successor that operandIndex
belongs to and the index of the argument to that successor that operandIndex
refers to.
If operandIndex
is not a successor operand, None is returned.
void Operation::destroy | ( | ) |
Destroys this operation and its subclass data.
Destroy this operation or one of its subclasses.
|
inline |
|
inline |
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.
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.
void Operation::dump | ( | ) |
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.
InFlightDiagnostic Operation::emitOpError | ( | const Twine & | message = {} | ) |
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers.
InFlightDiagnostic Operation::emitRemark | ( | const Twine & | message = {} | ) |
Emit a remark about this operation, reporting up to any diagnostic handlers that may be listening.
InFlightDiagnostic Operation::emitWarning | ( | const Twine & | message = {} | ) |
Emit a warning about this operation, reporting up to any diagnostic handlers that may be listening.
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.
|
inline |
Erase the operand at position idx
.
|
inline |
Erase a specific operand from the operand list of the successor at 'index'.
LogicalResult Operation::fold | ( | ArrayRef< Attribute > | operands, |
SmallVectorImpl< OpFoldResult > & | results | ||
) |
Attempt to fold this operation using the Op's registered foldHook.
Attempt to fold this operation with the specified constant operand values
results
vector. If not, results
is unspecified.
|
inline |
If this operation has a registered operation description, return it. Otherwise return null.
|
inline |
Return the specified attribute if present, null otherwise.
|
inline |
|
inline |
Return the internal attribute list on this operation.
|
inline |
|
inline |
|
inline |
Return all of the attributes on this operation.
|
inline |
Returns the operation block that contains this operation.
|
inline |
MLIRContext * Operation::getContext | ( | ) |
Return the context this operation is associated with.
Dialect * Operation::getDialect | ( | ) |
Return the dialect this operation is associated with, or nullptr if the associated dialect is not registered.
|
inline |
Return a range corresponding to the dialect attributes for this operation.
|
inline |
The source location the operation was defined or derived from.
|
inline |
The name of an operation is the key identifier for it.
auto Operation::getNonSuccessorOperands | ( | ) |
Return the operands of this operation that are not successor arguments.
|
inline |
|
inline |
Returns the number of regions held by this operation.
unsigned Operation::getNumResults | ( | ) |
Return the number of results held by this operation.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the closest surrounding parent operation that is of type 'OpTy'.
Operation * Operation::getParentOp | ( | ) |
Returns the closest surrounding operation that contains this operation or nullptr if this is a top-level operation.
Region * Operation::getParentRegion | ( | ) |
Returns the region to which the instruction belongs. Returns nullptr if the instruction is unlinked.
|
inline |
Returns the region held by this operation at position 'index'.
|
inline |
Returns the regions held by this operation.
|
inline |
Get the 'idx'th result of this operation.
|
inline |
|
inline |
|
inline |
|
inline |
Returns the BlockArgument
corresponding to operand operandIndex
in some successor, or None if operandIndex
isn't a successor operand index.
|
inline |
unsigned Operation::getSuccessorOperandIndex | ( | unsigned | index | ) |
Get the index of the first operand of the successor at the provided index.
auto Operation::getSuccessorOperands | ( | unsigned | index | ) |
|
inline |
|
inline |
Returns the status of whether this operation is a terminator or not.
|
inline |
Returns whether the operation has side-effects.
|
inline |
Returns if the operation has a resizable operation list, i.e. operands can be added.
|
inline |
|
inline |
Returns if the operation was registered with a particular trait, e.g. hasTrait<OperandsAreIntegerLike>().
|
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.
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.
|
inline |
Returns whether the operation is commutative.
|
inline |
Returns if the operation is known to be completely isolated from enclosing regions, i.e. no internal regions reference values defined above this operation.
|
inline |
Returns if the operation is known to not be a terminator.
|
inline |
Returns if the operation is known to be a terminator.
bool Operation::isProperAncestor | ( | Operation * | other | ) |
Return true if this operation is a proper ancestor of the other
operation.
|
inline |
Returns true if this operation has a registered operation description, otherwise false.
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.
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.
|
inline |
|
inline |
|
inline |
|
inline |
void Operation::print | ( | raw_ostream & | os, |
OpPrintingFlags | flags = llvm::None |
||
) |
|
inline |
Remove the attribute with the specified name if it exists. The return value indicates whether the attribute was present or not.
|
inline |
Replace all uses of results of this operation with the provided 'values'.
|
inline |
Replace all uses of results of this operation with results of 'op'.
Replace any uses of 'from' with 'to' within this operation.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
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.
|
inline |
|
inline |
Set the attribute list on this operation. Using a NamedAttributeList is more efficient as it does not require new uniquing in the MLIRContext.
|
inline |
Set the dialect attributes for this operation, and preserve all dependent.
|
inline |
Set the source location the operation was defined or derived from.
|
inline |
void Operation::setOperands | ( | ValueRange | operands | ) |
Replace the current operands of this operation with the ones provided in 'operands'. If the operands list is not resizable, the size of 'operands' must be less than or equal to the current number of operands.
void Operation::setSuccessor | ( | Block * | block, |
unsigned | index | ||
) |
|
inline |
|
inline |
|
inline |
Walk the operation in postorder, calling the callback for each nested operation(including this one). The callback method can take any of the following forms: void(Operation*) : Walk all operations opaquely.
|
friend |
|
friend |
|
friend |