MLIR  16.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
mlir::Value Class Reference

This class represents an instance of an SSA value in the MLIR system, representing a computable value that has a type and a set of users. More...

#include "mlir/IR/Value.h"

+ Inheritance diagram for mlir::Value:
+ Collaboration diagram for mlir::Value:

Public Types

using use_iterator = ValueUseIterator< OpOperand >
 This class implements an iterator over the uses of a value. More...
 
using use_range = iterator_range< use_iterator >
 
using user_iterator = ValueUserIterator< use_iterator, OpOperand >
 
using user_range = iterator_range< user_iterator >
 

Public Member Functions

constexpr Value (detail::ValueImpl *impl=nullptr)
 
template<typename U >
bool isa () const
 
template<typename First , typename Second , typename... Rest>
bool isa () const
 
template<typename U >
dyn_cast () const
 
template<typename U >
dyn_cast_or_null () const
 
template<typename U >
cast () const
 
 operator bool () const
 
bool operator== (const Value &other) const
 
bool operator!= (const Value &other) const
 
Type getType () const
 Return the type of this value. More...
 
MLIRContextgetContext () const
 Utility to get the associated MLIRContext that this value is defined in. More...
 
void setType (Type newType)
 Mutate the type of this Value to be of the specified type. More...
 
OperationgetDefiningOp () const
 If this value is the result of an operation, return the operation that defines it. More...
 
template<typename OpTy >
OpTy getDefiningOp () const
 If this value is the result of an operation of type OpTy, return the operation that defines it. More...
 
Location getLoc () const
 Return the location of this value. More...
 
void setLoc (Location loc)
 
RegiongetParentRegion ()
 Return the Region in which this Value is defined. More...
 
BlockgetParentBlock ()
 Return the Block in which this Value is defined. More...
 
void dropAllUses () const
 Drop all uses of this object from their respective owners. More...
 
void replaceAllUsesWith (Value newValue) const
 Replace all uses of 'this' value with the new value, updating anything in the IR that uses 'this' to use the other value instead. More...
 
void replaceAllUsesExcept (Value newValue, const SmallPtrSetImpl< Operation *> &exceptions) const
 Replace all uses of 'this' value with 'newValue', updating anything in the IR that uses 'this' to use the other value instead except if the user is listed in 'exceptions' . More...
 
void replaceAllUsesExcept (Value newValue, Operation *exceptedUser) const
 Replace all uses of 'this' value with 'newValue', updating anything in the IR that uses 'this' to use the other value instead except if the user is 'exceptedUser'. More...
 
void replaceUsesWithIf (Value newValue, function_ref< bool(OpOperand &)> shouldReplace)
 Replace all uses of 'this' value with 'newValue' if the given callback returns true. More...
 
bool isUsedOutsideOfBlock (Block *block)
 Returns true if the value is used outside of the given block. More...
 
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
 
void print (raw_ostream &os)
 
void print (raw_ostream &os, const OpPrintingFlags &flags)
 
void print (raw_ostream &os, AsmState &state)
 
void dump ()
 
void printAsOperand (raw_ostream &os, AsmState &state)
 Print this value as if it were an operand. More...
 
voidgetAsOpaquePointer () const
 Methods for supporting PointerLikeTypeTraits. More...
 
detail::ValueImplgetImpl () const
 

Static Public Member Functions

static Value getFromOpaquePointer (const void *pointer)
 

Protected Attributes

detail::ValueImplimpl
 A pointer to the internal implementation of the value. More...
 

Friends

::llvm::hash_code hash_value (Value arg)
 Make Value hashable. More...
 

Detailed Description

This class represents an instance of an SSA value in the MLIR system, representing a computable value that has a type and a set of users.

An SSA value is either a BlockArgument or the result of an operation. Note: This class has value-type semantics and is just a simple wrapper around a ValueImpl that is either owner by a block(in the case of a BlockArgument) or an Operation(in the case of an OpResult).

Definition at line 85 of file Value.h.

Member Typedef Documentation

◆ use_iterator

This class implements an iterator over the uses of a value.

Definition at line 190 of file Value.h.

◆ use_range

Definition at line 191 of file Value.h.

◆ user_iterator

Definition at line 208 of file Value.h.

◆ user_range

Definition at line 209 of file Value.h.

Constructor & Destructor Documentation

◆ Value()

constexpr mlir::Value::Value ( detail::ValueImpl impl = nullptr)
inline

Definition at line 87 of file Value.h.

Member Function Documentation

◆ cast()

template<typename U >
U mlir::Value::cast ( ) const
inline

◆ dropAllUses()

void mlir::Value::dropAllUses ( ) const
inline

Drop all uses of this object from their respective owners.

Definition at line 157 of file Value.h.

Referenced by buildUnresolvedTargetMaterialization().

◆ dump()

void Value::dump ( )

Definition at line 3369 of file AsmPrinter.cpp.

References print().

◆ dyn_cast()

template<typename U >
U mlir::Value::dyn_cast ( ) const
inline

Definition at line 100 of file Value.h.

Referenced by mlir::AsmParserState::addUses(), annotateConflict(), assertDestinationPassingStyle(), buildUnresolvedTargetMaterialization(), collapseBranch(), collectUnderlyingAddressValues(), destructureIndices(), mlir::bufferization::eliminateAllocTensors(), mlir::eraseUnreachableBlocks(), mlir::linalg::TileLoopNest::fuseProducer(), mlir::bufferization::OneShotAnalysisState::gatherYieldedTensors(), generateFusedElementwiseOpRegion(), getAllocEffectFor(), mlir::scf::getForeachThreadOpThreadIndexOwner(), mlir::getForInductionVarOwner(), getFusableProducer(), mlir::bufferization::getOwnerOfValue(), mlir::scf::getParallelForInductionVarOwner(), getProducerOfTensor(), mlir::SideEffects::EffectInstance< EffectT >::getSymbolRef(), mlir::SideEffects::EffectInstance< EffectT >::getValue(), getZero(), hasPrecedingAliasingNonWritableTensor(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), mlir::detail::PDLByteCode::initializeMutableState(), mlir::sparse_tensor::isAdmissableBranch(), mlir::sparse_tensor::isAdmissableBranchExp(), mlir::linalg::TileLoopNest::isEmpty(), mlir::bufferization::isFunctionArgument(), isMemoryWrite(), isMulChain(), isShapePreserving(), mlir::isTopLevelValue(), mlir::bufferization::OneShotAnalysisState::isWritable(), mlir::bufferization::func_ext::FuncOpInterface::isWritable(), linalgOpToLoopsImpl(), printInitializationList(), mlir::spirv::Serializer::printValueIDMap(), mlir::DominanceInfo::properlyDominates(), ReifyExpandOrCollapseShapeOp< OpTy >::reifyResultShapes(), mlir::runRegionDCE(), setInsertionPointAfter(), sourceMaterializationCallback(), specializeForLoopForUnrolling(), specializeParallelLoopForUnrolling(), mlir::dataflow::IntegerRangeAnalysis::visitNonControlFlowArguments(), mlir::dataflow::IntegerRangeAnalysis::visitOperation(), and wrapExternalFunction().

◆ dyn_cast_or_null()

template<typename U >
U mlir::Value::dyn_cast_or_null ( ) const
inline

Definition at line 104 of file Value.h.

◆ getAsOpaquePointer()

void* mlir::Value::getAsOpaquePointer ( ) const
inline

◆ getContext()

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

Utility to get the associated MLIRContext that this value is defined in.

Definition at line 121 of file Value.h.

References mlir::Type::getContext(), and mlir::detail::ValueImpl::getType().

Referenced by dropRefIfNoUses(), mlir::linalg::getUpperBoundForIndex(), isShapePreserving(), and walkReferenceCountedValues().

◆ getDefiningOp() [1/2]

Operation * Value::getDefiningOp ( ) const

If this value is the result of an operation, return the operation that defines it.

If this value is the result of an Operation, return the operation that defines it.

Definition at line 20 of file Value.cpp.

Referenced by mlir::FlatAffineValueConstraints::addInductionVarOrTerminalSymbol(), mlir::affineParallelize(), mlir::bufferization::allocateTensorForShapedValue(), mlir::bufferization::allocationDoesNotEscape(), allocBuffer(), analyzeProfitability(), mlir::linalg::areElementwiseOpsFusable(), assertDestinationPassingStyle(), buildAffineLoopFromValues(), mlir::scf::buildLoopNest(), collapseGenericOpIterationDims(), composeSetAndOperands(), computeNecessaryMaterializations(), convertOmpThreadprivate(), createMask(), defaultDeallocBufferCallBack(), defaultIsSmallAlloc(), deriveStaticUpperBound(), diagnoseInvalidOperandDominance(), mlir::DominanceInfo::dominates(), mlir::bufferization::dropEquivalentBufferResults(), dropRefIfNoUses(), mlir::bufferization::BufferizationOptions::dynCastBufferizableOp(), mlir::bufferization::eliminateAllocTensors(), extractConstantIndex(), findAncestorOpInRegion(), mlir::bufferization::AnalysisState::findLastPrecedingWrite(), findMatchingStartFinishInsts(), mlir::bufferization::AnalysisState::findValueInReverseUseDefChain(), foldExtractAfterInsertSlice(), foldExtractFromExtractStrided(), foldExtractFromShapeCast(), foldExtractOpFromExtractChain(), foldExtractStridedOpFromInsertChain(), mlir::OpTrait::impl::foldIdempotent(), foldInsertAfterExtractSlice(), mlir::OpTrait::impl::foldInvolution(), foldMemRefCast(), foldTransferInBoundsAttribute(), mlir::fullyComposeAffineMapAndOperands(), mlir::linalg::TileLoopNest::fuseProducer(), mlir::linalg::fuseProducerOfBuffer(), mlir::linalg::fuseProducerOfTensor(), fuseWithReshapeByExpansion(), mlir::bufferization::OneShotAnalysisState::gatherYieldedTensors(), generateFusedElementwiseOpRegion(), mlir::linalg::generateLibraryCallName(), mlir::bufferization::AnalysisState::getAliasingOpOperand(), mlir::ComputationSliceState::getAsConstraints(), mlir::getBackwardSlice(), mlir::bufferization::getBuffer(), getFusableProducer(), getGenericEffectsImpl(), getLoadStoreElementType(), getLoopInvariantTransferWriteOpDefining(), getMaskFormat(), getOperandTreePredicates(), mlir::scf::getParallelForInductionVarOwner(), getProducerOfTensor(), getRangeFromOperandShape(), mlir::shape::getShapeVec(), mlir::LivenessBlockInfo::getStartOperation(), getTreePredicates(), mlir::linalg::getUpperBoundForIndex(), getWarpResult(), hasAllocationScope(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), HoistingAnalysis::HoistingAnalysis(), mlir::inlineCall(), mlir::linalg::insertSlicesBack(), mlir::sparse_tensor::isAdmissableBranch(), mlir::sparse_tensor::isAdmissableBranchExp(), isAlloc(), isChainOfUnaryOpsFrom(), isConstantOne(), isDefinedByCallTo(), isEqualOffsetSizeOrStride(), isFusionProfitable(), isInBounds(), isLocallyDefined(), isMaterializing(), isMulChain(), isNeutralElementConst(), isOpLoopInvariant(), isOpReady(), mlir::bufferization::AnalysisState::isTensorYielded(), mlir::isTopLevelValue(), mlir::isValidDim(), mlir::isValidSymbol(), isZero(), isZeroYield(), legalizeUnresolvedMaterialization(), mlir::loopUnrollByFactor(), mlir::linalg::makeComposedPadHighOp(), ReshapeReshapeOptimization::matchAndRewrite(), ClampClampOptimization::matchAndRewrite(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), mlir::linalg::LinalgCopyVTRForwardingPattern::matchAndRewrite(), mlir::linalg::LinalgCopyVTWForwardingPattern::matchAndRewrite(), SelectToExtUI::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), mlir::matchConstantIndex(), mlir::detail::matchOperandOrValueAtIndex(), mlir::matchPattern(), normalizeLoop(), mlir::outlineSingleBlockRegion(), padOperandToSmallestStaticBoundingBox(), parseGlobalMemrefOpTypeAndInitialValue(), CommutativeOperand::popFrontAndPushAdjacentUnvisitedAncestors(), mlir::bufferization::populateDynamicDimSizes(), printOperation(), mlir::spirv::Serializer::printValueIDMap(), processParallelLoop(), mlir::DominanceInfo::properlyDominates(), relinkBranch(), remainsLegalAfterInline(), replaceDimOrSym(), mlir::Liveness::resolveLiveness(), mlir::linalg::LinalgPaddingPattern::returningMatchAndRewrite(), mlir::runRegionDCE(), setInsertionPointAfter(), mlir::OpBuilder::setInsertionPointAfterValue(), sourceMaterializationCallback(), mlir::linalg::splitReduction(), mlir::linalg::splitReductionByScaling(), tilePadOp(), GenericPadOpVectorizationPattern::tryVectorizeCopy(), validateSupportedControlFlow(), vectorizeOperand(), verifyAttributions(), verifyGroupNonUniformArithmeticOp(), and visitUpward().

◆ getDefiningOp() [2/2]

template<typename OpTy >
OpTy mlir::Value::getDefiningOp ( ) const
inline

If this value is the result of an operation of type OpTy, return the operation that defines it.

Definition at line 138 of file Value.h.

◆ getFromOpaquePointer()

static Value mlir::Value::getFromOpaquePointer ( const void pointer)
inlinestatic

◆ getImpl()

detail::ValueImpl* mlir::Value::getImpl ( ) const
inline

◆ getLoc()

Location Value::getLoc ( ) const

◆ getParentBlock()

Block * Value::getParentBlock ( )

◆ getParentRegion()

Region * Value::getParentRegion ( )

◆ getType()

Type mlir::Value::getType ( ) const
inline

Return the type of this value.

Definition at line 118 of file Value.h.

Referenced by ableToUpdatePredOperands(), addExecuteResults(), mlir::bufferization::allocateTensorForShapedValue(), analyzeProfitability(), appendX1Dim(), applyPad(), areAllLLVMTypes(), assertDestinationPassingStyle(), broadcast(), broadcastIfNeeded(), mlir::bufferization::func_ext::CallOpInterface::bufferize(), mlir::bufferization::func_ext::FuncOpInterface::bufferize(), mlir::tosa::buildConvOpQuantizationAttr(), mlir::tosa::buildConvOpResultTypeInfo(), buildLLVMFunctionType(), buildLogicalUnaryOp(), mlir::scf::buildLoopNest(), mlir::tosa::buildMatMulOpQuantizationAttr(), buildMatMulOpWithQuantInfo(), mlir::tosa::buildPadOpQuantizationAttr(), mlir::tosa::buildUnaryOpQuantizationAttr(), buildUnresolvedTargetMaterialization(), buildVectorComparison(), buildVectorWrite(), calculateImplicitMap(), castBoolToIntN(), castDataPtr(), castIntNToBool(), mlir::bufferization::castOrReallocMemRefValue(), ceilDivPositive(), mlir::detail::Parser::codeCompleteDialectSymbol(), collapseGenericOpIterationDims(), composeSetAndOperands(), computeCollapsedLayoutMap(), computeExpandedLayoutMap(), computeMemRefRankReductionMask(), computeNecessaryMaterializations(), mlir::linalg::computeSliceParameters(), computeTensorReshapeCollapsedType(), concatElemAndIndices(), convertContractOp(), convertToLaunchFuncOp(), mlir::AllocationOpLLVMLowering::createAligned(), mlir::tensor::createCanonicalRankReducingExtractSliceOp(), mlir::tensor::createCanonicalRankReducingInsertSliceOp(), createConst(), createDepthwiseConvCollapseMap(), mlir::tensor::createDimValues(), mlir::tensor::createDynamicDimValues(), mlir::linalg::createFoldedDimOp(), createFoldedDimOp(), createI32Constant(), createInitialVector(), createLinalgBodyCalculationForElementwiseOp(), mlir::createLoopFusionPass(), mlir::vector::createOrFoldDimOp(), mlir::linalg::createOrFoldDimOp(), createOrFoldDimOp(), createReassociationMapsForCollapse(), createSubViewIntersection(), mlir::bufferization::detail::defaultGetBufferType(), defaultIsSmallAlloc(), defaultUnknownTypeConverter(), destructureIndices(), doubleBuffer(), mlir::bufferization::dropEquivalentBufferResults(), dropTrailingX1Dim(), eachHasOnlyOneOfTypes(), elementwiseMatchAndRewriteHelper(), mlir::bufferization::eliminateAllocTensors(), ensureToMemrefOpIsValid(), executeGetOperandsResults(), extractLastDimSlice(), extractOne(), extractVectorElementType(), findAncestorOpInRegion(), findLiveUserOfReplaced(), foldExtractFromBroadcast(), foldExtractFromShapeCast(), foldExtractStridedOpFromInsertChain(), foldInsertAfterExtractSlice(), mlir::memref::foldMemRefCast(), foldMemRefCast(), foldTransferInBoundsAttribute(), forwardPassthroughAttributes(), forwardStoreToLoad(), forwardTerminatorOperands(), mlir::linalg::TileLoopNest::fuseProducer(), mlir::linalg::fuseProducerOfTensor(), mlir::bufferization::OneShotAnalysisState::gatherYieldedTensors(), genAddress(), generateCopy(), mlir::linalg::generateLibraryCallName(), generatePointWiseCopy(), genIndex(), genIndexValue(), genInsertionLoad(), genInvariants(), mlir::sparse_tensor::genIsNonzero(), genLoad(), genSubscript(), genTensorLoad(), genVectorInvariantValue(), mlir::AllocationOpLLVMLowering::getAlignment(), getAssumedUniqueReturnOp(), getBlockIt(), mlir::bufferization::getBuffer(), getBufferizationOptions(), mlir::bufferization::getBufferType(), getConvOutputDim(), mlir::AffineDmaStartOp::getDstMemorySpace(), mlir::AffineDmaStartOp::getDstMemRefRank(), mlir::AffineDmaStartOp::getDstMemRefType(), mlir::linalg::getDynOperands(), mlir::MemRefDescriptor::getElementPtrType(), getElementPtrType(), mlir::getElementTypeOrSelf(), getEnclosingforOps(), getFirstIntValue(), getFullMemRefAsRegion(), getGenericEffectsImpl(), getInsertExtractValueElementType(), getLoadStoreElementType(), getLocalInvocationDimSize(), getLspDiagnoticFromDiag(), mlir::dataflow::IntegerValueRange::getMaxRange(), mlir::AllocationOpLLVMLowering::getMemRefResultType(), mlir::bufferization::getMemRefType(), mlir::tensor::getMixedSizes(), getMultiLevelStrides(), getNeutralElement(), getOperandTreePredicates(), mlir::OperationFolder::getOrCreateConstant(), mlir::scf::getParallelForInductionVarOwner(), mlir::bufferization::getPartialBufferizationOptions(), getProducerOfTensor(), getReshapeOutputShapeFromInputShape(), mlir::ValueShapeRange::getShape(), getShapeDimSize(), getShapeDimSizes(), mlir::AffineDmaStartOp::getSrcMemorySpace(), mlir::AffineDmaStartOp::getSrcMemRefType(), mlir::AffineDmaStartOp::getTagMemRefRank(), mlir::AffineDmaWaitOp::getTagMemRefRank(), mlir::AffineDmaStartOp::getTagMemRefType(), mlir::AffineDmaWaitOp::getTagMemRefType(), getTreePredicates(), mlir::detail::TypedValue< Ty >::getType(), mlir::linalg::getUpperBoundForIndex(), mlir::getValueOrCreateCastToIndexLike(), mlir::nvgpu::getWarpMatrixInfo(), getZero(), mlir::LLVM::detail::handleMultidimensionalVectors(), hasAllocationScope(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), inferDynamicDimsForConv(), inferStridedSliceOpResultType(), mlir::inlineCall(), inlineRegionImpl(), insertCopies(), insertCopyLoops(), insertLastDimSlice(), insertOne(), mlir::scf::insideMutuallyExclusiveBranches(), isAccessIndexInvariant(), isComputeOperation(), isDefinedByCallTo(), isGpuAsyncTokenType(), isInBounds(), isLastMemrefDimUnitStride(), isMatchingWidth(), isMemRefNormalizable(), isNeutralElementConst(), isSparseTensor(), mlir::DataDescriptor::isValid(), mlir::isValidDim(), mlir::isValidSymbol(), mlir::bufferization::AnalysisState::isValueRead(), isZeroAttribute(), isZeroYield(), joinShapes(), legalizeUnresolvedMaterialization(), loadCSE(), logFailure(), mlir::linalg::makeMemRefCopyOp(), mlir::linalg::makeTransposeOp(), mlir::OperandElementTypeIterator::mapElement(), mlir::ResultElementTypeIterator::mapElement(), mlir::ValueTypeIterator< ValueIteratorT >::mapElement(), mlir::detail::constant_float_op_binder::match(), mlir::detail::constant_int_op_binder::match(), matchAndReplaceDepthwiseConv(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), ReshapeConstOptimization::matchAndRewrite(), MaxPool2dIsNoOp::matchAndRewrite(), ClampIsNoOp::matchAndRewrite(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), MaterializeTransferMask< ConcreteOp >::matchAndRewrite(), mlir::linalg::RegionMatcher::matchAsScalarBinaryOp(), mlir::linalg::materializeTiledShape(), mlir::MemRefDescriptor::MemRefDescriptor(), mfmaConcatIfNeeded(), mlir::x86vector::avx2::inline_asm::mm256BlendPsAsm(), mlir::normalizeMemRef(), mlir::OperationFolder::notifyRemoval(), SliceCanonicalizer::operator()(), mlir::detail::TypedValue< Ty >::operator=(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), optionallyTruncateOrExtend(), outlineExecuteOp(), parseInferType(), mlir::bufferization::populateDynamicDimSizes(), mlir::bufferization::populateEliminateBufferizeMaterializationsPatterns(), print(), printAtomicReductionRegion(), printAtomicUpdateOp(), printAttributions(), printAwaitResultType(), printCreateOperationOpResults(), mlir::OpAsmPrinter::printFunctionalType(), printGroupNonUniformArithmeticOp(), mlir::AsmPrinter::Impl::printIntegerSet(), printOneResultOp(), printOperandList(), printOperation(), printScheduleClause(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), reduceIfNeeded(), reduceMatchAndRewriteHelper(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), mlir::replaceAllMemRefUsesWith(), mlir::bufferization::replaceOpWithBufferizedValues(), replaceUnitExtents(), replaceUsesAndPropagateType(), replaceWithConstant(), reshapeLowerToHigher(), resolveUsesInRepetitiveRegions(), mlir::linalg::DownscaleSizeOneWindowed2DConvolution< Conv2DOp, Conv1DOp >::returningMatchAndRewrite(), mlir::linalg::DownscaleDepthwiseConv2DNhwcHwcOp::returningMatchAndRewrite(), mlir::linalg::rewriteAsPaddedOp(), mlir::runRegionDCE(), setInPlaceOpOperand(), mlir::DataDescriptor::setSize(), shouldPrintElementsAttrWithHex(), simplifyPassThroughBr(), sourceMaterializationCallback(), mlir::vector::splitFullAndPartialTransfer(), mlir::linalg::splitReduction(), mlir::linalg::splitReductionByScaling(), mlir::transform::tileToForeachThreadOpImpl(), mlir::detail::TypedValue< Ty >::TypedValue(), unpackOperandVector(), updateCalls(), vectorizeOperand(), vectorizeUniform(), vectorShape(), vectorType(), verifyAtomicCompareExchangeImpl(), verifyAtomicUpdateOp(), verifyBlockReadWritePtrAndValTypes(), mlir::detail::verifyBranchSuccessorOperands(), verifyCastOp(), mlir::linalg::detail::verifyDestinationStyleOpInterface(), verifyGroupNonUniformShuffleOp(), verifyJointMatrixMad(), verifyLoadStorePtrAndValTypes(), verifyMemoryOpIndexing(), verifyNumBlockArgs(), verifyReductionVarList(), verifyRegionAttribute(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), mlir::OpTrait::impl::verifySameTypeOperands(), verifyShiftOp(), verifyTensorReshapeOp(), verifyVectorMemoryOp(), verifyYield(), mlir::dataflow::IntegerRangeAnalysis::visitOperation(), visitUpward(), walkReferenceCountedValues(), and wrapExternalFunction().

◆ getUsers()

user_range mlir::Value::getUsers ( ) const
inline

◆ getUses()

use_range mlir::Value::getUses ( ) const
inline

◆ hasOneUse()

bool mlir::Value::hasOneUse ( ) const
inline

Returns true if this value has exactly one use.

Definition at line 200 of file Value.h.

Referenced by findMatchingStartFinishInsts(), mlir::linalg::TileLoopNest::isEmpty(), and ReshapeConstOptimization::matchAndRewrite().

◆ isa() [1/2]

template<typename U >
bool mlir::Value::isa ( ) const
inline

◆ isa() [2/2]

template<typename First , typename Second , typename... Rest>
bool mlir::Value::isa ( ) const
inline

Definition at line 96 of file Value.h.

◆ isUsedOutsideOfBlock()

bool Value::isUsedOutsideOfBlock ( Block block)

Returns true if the value is used outside of the given block.

Definition at line 90 of file Value.cpp.

References mlir::Operation::getBlock().

Referenced by mlir::Operation::isUsedOutsideOfBlock().

◆ operator bool()

mlir::Value::operator bool ( ) const
inlineexplicit

Definition at line 113 of file Value.h.

◆ operator!=()

bool mlir::Value::operator!= ( const Value other) const
inline

Definition at line 115 of file Value.h.

◆ operator==()

bool mlir::Value::operator== ( const Value other) const
inline

Definition at line 114 of file Value.h.

References impl.

◆ print() [1/3]

void Value::print ( raw_ostream &  os)

Definition at line 3340 of file AsmPrinter.cpp.

References print().

Referenced by isOpLoopInvariant(), mlir::Diagnostic::operator<<(), and mlir::operator<<().

◆ print() [2/3]

void Value::print ( raw_ostream &  os,
const OpPrintingFlags flags 
)

◆ print() [3/3]

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

◆ printAsOperand()

void Value::printAsOperand ( raw_ostream &  os,
AsmState state 
)

Print this value as if it were an operand.

Definition at line 3374 of file AsmPrinter.cpp.

References mlir::AsmState::getImpl(), and mlir::detail::AsmStateImpl::getSSANameState().

◆ replaceAllUsesExcept() [1/2]

void Value::replaceAllUsesExcept ( Value  newValue,
const SmallPtrSetImpl< Operation *> &  exceptions 
) const

Replace all uses of 'this' value with 'newValue', updating anything in the IR that uses 'this' to use the other value instead except if the user is listed in 'exceptions' .

Replace all uses of 'this' value with the new value, updating anything in the IR that uses 'this' to use the other value instead except if the user is listed in 'exceptions' .

Definition at line 61 of file Value.cpp.

Referenced by mlir::linalg::TileLoopNest::fuseProducer(), mlir::normalizeAffineParallel(), and mlir::scf::tileParallelLoop().

◆ replaceAllUsesExcept() [2/2]

void Value::replaceAllUsesExcept ( Value  newValue,
Operation exceptedUser 
) const

Replace all uses of 'this' value with 'newValue', updating anything in the IR that uses 'this' to use the other value instead except if the user is 'exceptedUser'.

Definition at line 72 of file Value.cpp.

◆ replaceAllUsesWith()

void mlir::Value::replaceAllUsesWith ( Value  newValue) const
inline

Replace all uses of 'this' value with the new value, updating anything in the IR that uses 'this' to use the other value instead.

When this returns there are zero uses of 'this'.

Definition at line 162 of file Value.h.

Referenced by buildUnresolvedTargetMaterialization(), forwardStoreToLoad(), mlir::inlineCall(), insertCopies(), isConstantOne(), loadCSE(), mlir::normalizeMemRef(), replaceWithConstant(), and mlir::OperationFolder::tryToFold().

◆ replaceUsesWithIf()

void Value::replaceUsesWithIf ( Value  newValue,
function_ref< bool(OpOperand &)>  shouldReplace 
)

Replace all uses of 'this' value with 'newValue' if the given callback returns true.

Definition at line 82 of file Value.cpp.

Referenced by getZero(), mlir::outlineSingleBlockRegion(), and replaceIterArgs().

◆ setLoc()

void Value::setLoc ( Location  loc)

Definition at line 33 of file Value.cpp.

◆ setType()

void mlir::Value::setType ( Type  newType)
inline

Mutate the type of this Value to be of the specified type.

Note that this is an extremely dangerous operation which can create completely invalid IR very easily. It is strongly recommended that you recreate IR objects with the right types instead of mutating them in place.

Definition at line 129 of file Value.h.

Referenced by mlir::detail::TypedValue< Ty >::setType().

◆ use_begin()

use_iterator mlir::Value::use_begin ( ) const
inline

Definition at line 193 of file Value.h.

◆ use_empty()

bool mlir::Value::use_empty ( ) const
inline

◆ use_end()

use_iterator mlir::Value::use_end ( ) const
inline

Definition at line 194 of file Value.h.

◆ user_begin()

user_iterator mlir::Value::user_begin ( ) const
inline

◆ user_end()

user_iterator mlir::Value::user_end ( ) const
inline

Friends And Related Function Documentation

◆ hash_value

::llvm::hash_code hash_value ( Value  arg)
friend

Make Value hashable.

Definition at line 479 of file Value.h.

Member Data Documentation

◆ impl

detail::ValueImpl* mlir::Value::impl
protected

A pointer to the internal implementation of the value.

Definition at line 237 of file Value.h.

Referenced by operator==().


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