MLIR  20.0.0git
Public Member Functions | List of all members
mlir::IROperand< DerivedT, IRValueT > Class Template Reference

A reference to a value, suitable for use as an operand of an operation. More...

#include "mlir/IR/UseDefLists.h"

+ Inheritance diagram for mlir::IROperand< DerivedT, IRValueT >:

Public Member Functions

 IROperand (Operation *owner)
 
 IROperand (Operation *owner, IRValueT value)
 
 IROperand (IROperand &&other)
 We support a move constructor so IROperand's can be in vectors, but this shouldn't be used by general clients. More...
 
IROperandoperator= (IROperand &&other)
 
bool operator== (const IROperand< DerivedT, IRValueT > &other) const
 Two operands are equal if they have the same owner and the same operand number. More...
 
bool operator!= (const IROperand< DerivedT, IRValueT > &other) const
 
IRValueT get () const
 Return the current value being used by this operand. More...
 
void set (IRValueT newValue)
 Set the current value being used by this operand. More...
 
bool is (IRValueT other) const
 Returns true if this operand contains the given value. More...
 
void drop ()
 Remove this use of the operand. More...
 
- Public Member Functions inherited from mlir::detail::IROperandBase
OperationgetOwner () const
 Return the owner of this operand. More...
 
IROperandBasegetNextOperandUsingThisValue ()
 Return the next operand on the use-list of the value we are referring to. More...
 
void initChainWithUse (IROperandBase **self)
 Initialize the use-def chain by setting the back address to self and nextUse to nullptr. More...
 
void linkTo (IROperandBase *next)
 Link the current node to next. More...
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::detail::IROperandBase
 IROperandBase (Operation *owner)
 
 IROperandBase (IROperandBase &&other)
 
IROperandBaseoperator= (IROperandBase &&other)
 
 IROperandBase (const IROperandBase &use)=delete
 Operands are not copyable or assignable. More...
 
IROperandBaseoperator= (const IROperandBase &use)=delete
 
 ~IROperandBase ()
 
void drop ()
 Remove this use of the operand. More...
 
void removeFromCurrent ()
 Remove this operand from the current use list. More...
 
template<typename UseListT >
void insertInto (UseListT *useList)
 Insert this operand into the given use list. More...
 
- Protected Attributes inherited from mlir::detail::IROperandBase
IROperandBasenextUse = nullptr
 The next operand in the use-chain. More...
 
IROperandBase ** back = nullptr
 This points to the previous link in the use-chain. More...
 

Detailed Description

template<typename DerivedT, typename IRValueT>
class mlir::IROperand< DerivedT, IRValueT >

A reference to a value, suitable for use as an operand of an operation.

IRValueT is the root type to use for values this tracks. Derived operand types are expected to provide the following:

Definition at line 127 of file UseDefLists.h.

Constructor & Destructor Documentation

◆ IROperand() [1/3]

template<typename DerivedT , typename IRValueT >
mlir::IROperand< DerivedT, IRValueT >::IROperand ( Operation owner)
inline

Definition at line 129 of file UseDefLists.h.

◆ IROperand() [2/3]

template<typename DerivedT , typename IRValueT >
mlir::IROperand< DerivedT, IRValueT >::IROperand ( Operation owner,
IRValueT  value 
)
inline

Definition at line 130 of file UseDefLists.h.

◆ IROperand() [3/3]

template<typename DerivedT , typename IRValueT >
mlir::IROperand< DerivedT, IRValueT >::IROperand ( IROperand< DerivedT, IRValueT > &&  other)
inline

We support a move constructor so IROperand's can be in vectors, but this shouldn't be used by general clients.

Definition at line 137 of file UseDefLists.h.

Member Function Documentation

◆ drop()

template<typename DerivedT , typename IRValueT >
void mlir::IROperand< DerivedT, IRValueT >::drop ( )
inline

Remove this use of the operand.

Definition at line 175 of file UseDefLists.h.

References mlir::detail::IROperandBase::drop().

◆ get()

template<typename DerivedT , typename IRValueT >
IRValueT mlir::IROperand< DerivedT, IRValueT >::get ( ) const
inline

Return the current value being used by this operand.

Definition at line 160 of file UseDefLists.h.

Referenced by areBinOpsSwapped(), mlir::linalg::areElementwiseOpsFusable(), mlir::bufferization::OneShotAnalysisState::bufferizeInPlace(), buildPackingLoopNestImpl(), canBeHoisted(), cloneAndFuseFirstUse(), computePaddedShape(), fuse(), mlir::linalg::fuseElementwiseOps(), mlir::linalg::fuseProducerOfTensor(), genBuffers(), genConstantDenseAddressFromLevel(), generateFusedElementwiseOpRegion(), genExpand(), genIndex(), genInsertionLoad(), genInvariants(), genResult(), genSubscript(), genTensorLoad(), getAllTidLvlsInLatPoints(), getCollapsedOpOperand(), mlir::mesh::getMeshSharding(), mlir::Operation::getOperand(), getSharding(), getUntiledProducerFromSliceSource(), getUnusedOutOperand(), mlir::getUsedValuesDefinedAbove(), hasNonTrivialAffineOnSparseOut(), mlir::linalg::hoistRedundantVectorBroadcasts(), hoistSubsetAtIterArg(), mlir::sparse_tensor::CodegenEnv::isAdmissibleTensorExp(), mlir::linalg::isaFillOpInterface(), isMaterializing(), isSparseTensor(), isValueUsePotentialConsumer(), mlir::mesh::maybeInsertSourceShardingAnnotation(), mlir::mesh::maybeInsertTargetShardingAnnotation(), numEnclosingInvariantLoops(), mlir::linalg::padAndHoistLinalgOp(), padOperandToSmallestStaticBoundingBox(), relinkBranch(), mlir::scf::replaceAndCastForOpIterArg(), setInPlaceOpOperand(), mlir::sparse_tensor::CodegenEnv::startEmit(), mlir::scf::tileAndFuseConsumerOfSlice(), tileAndFuseFirstExtractUseThroughContainingOpBlockArgument(), transposeOneLinalgOperandAndReplace(), mlir::linalg::detail::verifyStructuredOpInterface(), verifyYield(), mlir::dataflow::LivenessAnalysis::visitBranchOperand(), and mlir::dataflow::LivenessAnalysis::visitCallOperand().

◆ is()

template<typename DerivedT , typename IRValueT >
bool mlir::IROperand< DerivedT, IRValueT >::is ( IRValueT  other) const
inline

Returns true if this operand contains the given value.

Definition at line 172 of file UseDefLists.h.

◆ operator!=()

template<typename DerivedT , typename IRValueT >
bool mlir::IROperand< DerivedT, IRValueT >::operator!= ( const IROperand< DerivedT, IRValueT > &  other) const
inline

Definition at line 155 of file UseDefLists.h.

◆ operator=()

template<typename DerivedT , typename IRValueT >
IROperand& mlir::IROperand< DerivedT, IRValueT >::operator= ( IROperand< DerivedT, IRValueT > &&  other)
inline

Definition at line 140 of file UseDefLists.h.

References mlir::detail::IROperandBase::operator=().

◆ operator==()

template<typename DerivedT , typename IRValueT >
bool mlir::IROperand< DerivedT, IRValueT >::operator== ( const IROperand< DerivedT, IRValueT > &  other) const
inline

Two operands are equal if they have the same owner and the same operand number.

They are stored inside of ops, so it is valid to compare their pointers to determine equality.

Definition at line 152 of file UseDefLists.h.

◆ set()

template<typename DerivedT , typename IRValueT >
void mlir::IROperand< DerivedT, IRValueT >::set ( IRValueT  newValue)
inline

Set the current value being used by this operand.

Definition at line 163 of file UseDefLists.h.

References mlir::detail::IROperandBase::removeFromCurrent().

Referenced by mlir::linalg::fuseProducerOfTensor(), mlir::Operation::setOperand(), and mlir::scf::tileAndFuseConsumerOfSlice().


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