MLIR  19.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:

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 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 ()
 Drop all uses of this object from their respective owners. More...
 
void replaceAllUsesWith (Value newValue)
 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)
 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)
 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) const
 Returns true if the value is used outside of the given block. More...
 
void shuffleUseList (ArrayRef< unsigned > indices)
 Shuffle the use list order according to the provided indices. 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) const
 
void print (raw_ostream &os, const OpPrintingFlags &flags) const
 
void print (raw_ostream &os, AsmState &state) const
 
void dump () const
 
void printAsOperand (raw_ostream &os, AsmState &state) const
 Print this value as if it were an operand. More...
 
void printAsOperand (raw_ostream &os, const OpPrintingFlags &flags) const
 
void * getAsOpaquePointer () 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). As most IR constructs, this isn't const-correct, but we keep method consistent and as such method that immediately modify this Value aren't marked const (include modifying the Value use-list).

Definition at line 96 of file Value.h.

Member Typedef Documentation

◆ use_iterator

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

Definition at line 205 of file Value.h.

◆ use_range

Definition at line 206 of file Value.h.

◆ user_iterator

Definition at line 223 of file Value.h.

◆ user_range

Definition at line 224 of file Value.h.

Constructor & Destructor Documentation

◆ Value()

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

Definition at line 98 of file Value.h.

Member Function Documentation

◆ cast()

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

Definition at line 120 of file Value.h.

◆ dropAllUses()

void mlir::Value::dropAllUses ( )
inline

Drop all uses of this object from their respective owners.

Definition at line 168 of file Value.h.

◆ dump()

void Value::dump ( ) const

Definition at line 3885 of file AsmPrinter.cpp.

References print().

◆ dyn_cast()

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

Definition at line 108 of file Value.h.

◆ dyn_cast_or_null()

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

Definition at line 114 of file Value.h.

◆ getAsOpaquePointer()

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

Methods for supporting PointerLikeTypeTraits.

Definition at line 243 of file Value.h.

References impl.

Referenced by ValueEquivalenceCache::checkCommutativeEquivalent(), and llvm::PointerLikeTypeTraits< mlir::Value >::getAsVoidPointer().

◆ getContext()

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

◆ 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::affine::affineParallelize(), mlir::bufferization::allocateTensorForShapedValue(), mlir::transform::TransformState::applyTransform(), mlir::linalg::areElementwiseOpsFusable(), MmaSyncBuilder::buildMmaSync(), composeSetAndOperands(), computeNecessaryMaterializations(), convertOmpThreadprivate(), createInlinedCompareImplementation(), defaultDeallocBufferCallBack(), defaultIsSmallAlloc(), delinearizeInductionVariable(), denormalizeInductionVariable(), mlir::DominanceInfo::dominates(), mlir::bufferization::dropEquivalentBufferResults(), mlir::bufferization::AnalysisState::findValueInReverseUseDefChain(), foldExtractAfterInsertSlice(), foldInsertAfterExtractSlice(), mlir::affine::fullyComposeAffineMapAndOperands(), mlir::linalg::fuseProducerOfTensor(), generateFusedElementwiseOpRegion(), get2To4PruneFlag(), mlir::vector::getAsIntegers(), mlir::getBackwardSlice(), getBase(), mlir::bufferization::getBuffer(), getCompressedMaskOp(), getDefiningOp(), getMaskFormat(), mlir::mesh::getMeshShardingAttr(), getOperandTreePredicates(), mlir::tensor::getOrCreateDestination(), getOwnerOfValue(), getProducerOfTensor(), getRangeFromOperandShape(), getRefPtrIfDeclareTarget(), getRegisterType(), mlir::shape::getShapeVec(), mlir::LivenessBlockInfo::getStartOperation(), getTreePredicates(), mlir::sparse_tensor::getTuple(), getUnderlyingObject(), getUnderlyingObjectSet(), getViewBase(), getWarpResult(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), haveNoReadsAfterWriteExceptSameIndex(), mlir::linalg::hoistPaddingOnTensors(), mlir::sparse_tensor::LoopEmitter::initializeLoopEmit(), mlir::sparse_tensor::isCertainZero(), isContiguousLoadIdx(), mlir::linalg::detail::isContractionBody(), isDeclareTargetLink(), isDefinedByCallTo(), isEscapingMemref(), isLocallyDefined(), isLoopInvariantIdx(), isMaterializing(), isMulChain(), mlir::affine::isTopLevelValue(), mlir::affine::isValidDim(), mlir::affine::isValidSymbol(), mlir::linalg::makeComposedPadHighOp(), mlir::makeRegionIsolatedFromAbove(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), ConcatSliceOptimization::matchAndRewrite(), mlir::linalg::LinalgCopyVTRForwardingPattern::matchAndRewrite(), mlir::linalg::LinalgCopyVTWForwardingPattern::matchAndRewrite(), mayAlias(), mlir::mesh::maybeInsertSourceShardingAnnotation(), movePaddingToFillOrGenericOp(), noAliasingUseInLoop(), mlir::linalg::offsetIndices(), mlir::bufferization::ValueComparator::operator()(), mlir::outlineSingleBlockRegion(), mlir::linalg::padAndHoistLinalgOp(), padThroughLoopIterArg(), CommutativeOperand::popFrontAndPushAdjacentUnvisitedAncestors(), printOperation(), processParallelLoop(), mlir::ValueBoundsConstraintSet::processWorklist(), mlir::DominanceInfo::properlyDominates(), reifyOrComputeDynamicSizes(), remainsLegalAfterInline(), replaceDimOrSym(), mlir::Liveness::resolveLiveness(), mlir::linalg::rewriteInDestinationPassingStyle(), setInsertionPointAfter(), setInsertionPointToStart(), tracesBackToExpectedValue(), tryFoldTensors(), tryToEnforceAlignment(), GenericPadOpVectorizationPattern::tryVectorizeCopy(), mlir::bufferization::detail::unknownGetAliasingOpOperands(), mlir::spirv::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 149 of file Value.h.

References getDefiningOp().

◆ 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 129 of file Value.h.

Referenced by mlir::ArithBuilder::add(), addBodyWithPayloadOp(), mlir::affine::MemRefDependenceGraph::addEdge(), addExecuteResults(), mlir::bufferization::allocateTensorForShapedValue(), mlir::allOperandsHaveSameCoopMatrixType(), appendX1Dim(), applyPad(), mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), applyToIntegerAttrs(), mlir::transform::TransformState::applyTransform(), mlir::linalg::areElementwiseOpsFusable(), assertValidValueDim(), bitAndAddrspaceCast(), broadcast(), broadcastDynamicDimension(), broadcastDynamicDimensions(), broadcastIfNeeded(), mlir::MemRefDescriptor::bufferPtr(), mlir::tosa::buildConvOpQuantizationAttr(), mlir::tosa::buildConvOpResultTypeInfo(), buildDivOp(), mlir::sparse_tensor::Merger::buildExp(), mlir::tosa::buildMatMulOpQuantizationAttr(), buildMatMulOpWithQuantInfo(), MmaSyncBuilder::buildMmaSync(), mlir::tosa::buildPadOpQuantizationAttr(), mlir::sparse_tensor::buildRelu(), buildSubAndExpOp(), mlir::tosa::buildUnaryOpQuantizationAttr(), calculateMemoryRequirements(), castAllocFuncResult(), castBoolToIntN(), castIntNToBool(), castIntValueToSameSizedType(), mlir::bufferization::castOrReallocMemRefValue(), castSameSizedTypes(), castToCompatibleMemRefType(), castToF32(), castToSameSizedInt(), castToSourceType(), ceilDivPositive(), checkLayout(), clampInput(), mlir::detail::TypedValue< Ty >::classof(), collapseInnerDims(), collapseValue(), mlir::ValueBoundsConstraintSet::computeBound(), computeNecessaryMaterializations(), mlir::linalg::computeSliceParameters(), computeTargetSize(), convertIntrinsicResult(), convertScalarToComplexDtype(), mlir::convertScalarToDtype(), convertScalarToFpDtype(), convertScalarToIntDtype(), convertToLaunchFuncOp(), create4x128BitSuffle(), mlir::linalg::createAdd(), mlir::AllocationOpLLVMLowering::createAligned(), createBinarySearchFunc(), mlir::tensor::createCanonicalRankReducingExtractSliceOp(), mlir::tensor::createCanonicalRankReducingInsertSliceOp(), mlir::memref::createCanonicalRankReducingSubViewOp(), createDecl(), mlir::tensor::createDynamicDimValues(), createExtractAndCast(), mlir::linalg::createFoldedDimOp(), createFullPartialVectorTransferRead(), createGroupReduceOpImpl(), createInsertAndCast(), mlir::LLVM::detail::createIntrinsicCall(), mlir::arm_sme::createLoopOverTileSlices(), createMemcpy(), mlir::vector::createOrFoldDimOp(), mlir::linalg::createOrFoldDimOp(), mlir::sparse_tensor::createOrFoldSliceOffsetOp(), mlir::sparse_tensor::createOrFoldSliceStrideOp(), createPartitionFunc(), createQuickSort(), createQuickSortFunc(), mlir::vector::createReadOrMaskedRead(), createScanLoop(), createShiftDownFunc(), createSortStableFunc(), createSubViewIntersection(), createTruncatedFPValue(), createWriteOrMaskedWrite(), declareReduction(), mlir::bufferization::detail::defaultGetBufferType(), defaultIsSmallAlloc(), dispatchMappedValues(), doubleBuffer(), mlir::bufferization::dropEquivalentBufferResults(), dropTrailingX1Dim(), emitElementwiseComputation(), emitNormalizedLoopBounds(), ensureToMemrefOpIsValid(), mlir::tosa::EqualizeRanks(), expandRank(), expandValue(), extendMaskRank(), extendVectorRank(), extractLastDimSlice(), extractOne(), mlir::bufferization::AnalysisState::findValueInReverseUseDefChain(), foldExtractFromBroadcast(), foreachIndividualVectorElement(), forwardStoreToLoad(), mlir::affine::fullyComposeAndComputeConstantDelta(), mlir::linalg::fuseProducerOfTensor(), mlir::sparse_tensor::genCast(), genCompressed(), genConditionalInsert(), generatePointWiseCopy(), genIf(), mlir::sparse_tensor::genIndexLoad(), mlir::sparse_tensor::genIsNonzero(), genSliceOffset(), genSliceStride(), genSliceToSize(), genStore(), mlir::sparse_tensor::genToMemref(), mlir::bufferization::getBuffer(), mlir::getBufferizationOptionsForSparsification(), mlir::bufferization::getBufferType(), getConstantUint32(), getContext(), getConvOrPoolOutputDim(), getDimValue(), mlir::MemRefDescriptor::getElementPtrType(), mlir::getElementTypeOrSelf(), mlir::ValueBoundsConstraintSet::getExpr(), getFlatOffsetAndStrides(), getGenericEffectsImpl(), mlir::dataflow::IntegerValueRange::getMaxRange(), mlir::bufferization::getMemRefType(), mlir::memref::getMixedSize(), mlir::tensor::getMixedSize(), mlir::memref::getMixedSizes(), mlir::tensor::getMixedSizes(), getMultiLevelStrides(), getNumNonTrivialIdxExpOnSparseLvls(), getOffsetForBitwidth(), mlir::spirv::getOpenCLElementPtr(), getOperandTreePredicates(), mlir::tensor::getOrCreateDestination(), getOrFoldTensorDim(), mlir::bufferization::getPartialBufferizationOptions(), getProducerOfTensor(), mlir::xegpu::getRankOf(), getRegisterType(), getReshapeOutputShapeFromInputShape(), getScalarOrElementWidth(), mlir::ValueShapeRange::getShape(), getShardingAttribute(), getSlice(), mlir::sparse_tensor::getSparseTensorType(), getTreePredicates(), mlir::detail::TypedValue< Ty >::getType(), mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::getType(), mlir::getValueOrCreateCastToIndexLike(), handleArgumentImpl(), handleByValArgumentInit(), handleResultImpl(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), inferDynamicDimsForConv(), mlir::sparse_tensor::LoopEmitter::initialize(), mlir::sparse_tensor::LoopEmitter::initializeLoopEmit(), inlineOmpRegionCleanup(), insertCopies(), insertCopyLoops(), insertLastDimSlice(), insertOne(), mlir::NVVM::PtxBuilder::insertValue(), isAccessIndexInvariant(), isDefinedByCallTo(), mlir::OperationEquivalence::isEquivalentTo(), isGpuAsyncTokenType(), isMemref(), mlir::OperationEquivalence::isRegionEquivalentTo(), mlir::BufferOriginAnalysis::isSameAllocation(), isSparseTensor(), mlir::affine::isValidDim(), mlir::affine::isValidSymbol(), isValueCompatibleWithFullReplicationSharding(), mlir::bufferization::AnalysisState::isValueRead(), legalizeUnresolvedMaterialization(), linalgBroadcastAndMaybeExtSI(), linalgIntBroadcastExtSIAdd(), mlir::sparse_tensor::loadAll(), mlir::linalg::makeMemRefCopyOp(), mlir::linalg::makeTransposeOp(), mlir::ValueTypeIterator< ValueIteratorT >::mapElement(), mlir::OperandElementTypeIterator::mapElement(), mlir::ResultElementTypeIterator::mapElement(), matchAndReplaceDepthwiseConv(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), ConvertAccessChain::matchAndRewrite(), mlir::affine::materializeComputedBound(), mlir::linalg::materializeTiledShape(), mlir::BufferViewFlowAnalysis::mayBeTerminalBuffer(), mlir::MemRefDescriptor::MemRefDescriptor(), mfmaConcatIfNeeded(), mlir::x86vector::avx2::inline_asm::mm256BlendPsAsm(), movePaddingToFillOrGenericOp(), mlir::ArithBuilder::mul(), needFlatten(), mlir::affine::normalizeMemRef(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), optionallyTruncateOrExtend(), outlineExecuteOp(), mlir::linalg::pack(), padOperandToSmallestStaticBoundingBox(), mlir::bufferization::populateDynamicDimSizes(), printAttributions(), printFunctionArgs(), mlir::spirv::printGroupNonUniformArithmeticOp(), mlir::ValueBoundsConstraintSet::processWorklist(), mlir::scf::promote(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), rankReducingSubviewDroppingUnitDims(), reduce(), reifyOrComputeDynamicSizes(), mlir::arith::reifyValueBound(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), mlir::affine::MemRefDependenceGraph::removeEdge(), mlir::affine::replaceAllMemRefUsesWith(), replaceUsesAndPropagateType(), replaceWithConstant(), mlir::linalg::DownscaleSizeOneWindowed2DConvolution< Conv2DOp, Conv1DOp >::returningMatchAndRewrite(), mlir::linalg::DownscaleConv2DOp::returningMatchAndRewrite(), mlir::linalg::DownscaleDepthwiseConv2DNhwcHwcOp::returningMatchAndRewrite(), mlir::linalg::rewriteAsPaddedOp(), rewriteI4ToI8SignedExt(), rewriteI4ToI8UnsignedExt(), rewriteI8ToI4Trunc(), mlir::linalg::rewriteInIm2Col(), mlir::ArithBuilder::sgt(), shiftValue(), mlir::ArithBuilder::slt(), mlir::sparse_tensor::IterationGraphSorter::sort(), mlir::vector::splitFullAndPartialTransfer(), mlir::sparse_tensor::storeAll(), mlir::ArithBuilder::sub(), mlir::linalg::transposeBatchMatmul(), mlir::linalg::transposeMatmul(), transposeOneLinalgOperandAndReplace(), transposeToShuffle16x16(), truncToI32(), mlir::sparse_tensor::tryGetSparseTensorType(), unpackOperandVector(), mlir::ValueBoundsConstraintSet::Variable::Variable(), vectorizeDynamicConvOpPrecondition(), vectorShape(), verifyAllToAllOperandAndResultShape(), verifyGatherOperandAndResultShape(), verifyScatterOrSliceOperandAndResultShape(), visitUpward(), wmmaPushInputOperand(), wmmaPushOutputOperand(), 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

◆ isa()

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

Definition at line 102 of file Value.h.

◆ isUsedOutsideOfBlock()

bool Value::isUsedOutsideOfBlock ( Block block) const

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

Definition at line 89 of file Value.cpp.

References mlir::Operation::getBlock().

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

◆ operator bool()

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

Definition at line 124 of file Value.h.

References impl.

◆ operator!=()

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

Definition at line 126 of file Value.h.

◆ operator==()

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

Definition at line 125 of file Value.h.

References impl.

◆ print() [1/3]

void Value::print ( raw_ostream &  os) const

Definition at line 3856 of file AsmPrinter.cpp.

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

◆ print() [2/3]

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

Definition at line 3870 of file AsmPrinter.cpp.

◆ print() [3/3]

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

Definition at line 3857 of file AsmPrinter.cpp.

◆ printAsOperand() [1/2]

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

Print this value as if it were an operand.

Definition at line 3890 of file AsmPrinter.cpp.

◆ printAsOperand() [2/2]

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

Definition at line 3915 of file AsmPrinter.cpp.

◆ replaceAllUsesExcept() [1/2]

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

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.

◆ replaceAllUsesExcept() [2/2]

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

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)
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 173 of file Value.h.

Referenced by forwardStoreToLoad(), loadCSE(), mlir::OpTrait::OneResult< ConcreteType >::replaceAllUsesWith(), and replaceWithConstant().

◆ 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 81 of file Value.cpp.

Referenced by mlir::outlineSingleBlockRegion().

◆ 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 140 of file Value.h.

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

◆ shuffleUseList()

void Value::shuffleUseList ( ArrayRef< unsigned >  indices)

Shuffle the use list order according to the provided indices.

Shuffles the use-list order according to the provided indices.

It is responsibility of the caller to make sure that the indices map the current use-list chain to another valid use-list chain.

Definition at line 96 of file Value.cpp.

◆ use_begin()

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

Definition at line 208 of file Value.h.

Referenced by getUses(), mlirValueGetFirstUse(), and user_begin().

◆ use_empty()

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

◆ use_end()

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

Definition at line 209 of file Value.h.

Referenced by getUses(), and user_end().

◆ user_begin()

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

Definition at line 226 of file Value.h.

References use_begin().

Referenced by getUsers(), and isResultValueDead().

◆ user_end()

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

Definition at line 227 of file Value.h.

References use_end().

Referenced by computeNecessaryMaterializations(), findLiveUserOfReplaced(), and getUsers().

Friends And Related Function Documentation

◆ hash_value

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

Make Value hashable.

Definition at line 490 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 253 of file Value.h.

Referenced by getAsOpaquePointer(), getImpl(), operator bool(), and operator==().


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