MLIR 22.0.0git
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.
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)
 operator bool () const
bool operator== (const Value &other) const
bool operator!= (const Value &other) const
Type getType () const
 Return the type of this value.
MLIRContextgetContext () const
 Utility to get the associated MLIRContext that this value is defined in.
void setType (Type newType)
 Mutate the type of this Value to be of the specified type.
OperationgetDefiningOp () const
 If this value is the result of an operation, return the operation that defines it.
template<typename OpTy>
OpTy getDefiningOp () const
 If this value is the result of an operation of type OpTy, return the operation that defines it.
Location getLoc () const
 Return the location of this value.
void setLoc (Location loc)
RegiongetParentRegion ()
 Return the Region in which this Value is defined.
BlockgetParentBlock ()
 Return the Block in which this Value is defined.
void dropAllUses ()
 Drop all uses of this object from their respective owners.
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.
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' .
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'.
void replaceUsesWithIf (Value newValue, function_ref< bool(OpOperand &)> shouldReplace)
 Replace all uses of 'this' value with 'newValue' if the given callback returns true.
bool isUsedOutsideOfBlock (Block *block) const
 Returns true if the value is used outside of the given block.
void shuffleUseList (ArrayRef< unsigned > indices)
 Shuffle the use list order according to the provided indices.
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.
unsigned getNumUses () const
 This method computes the number of uses of this Value.
bool hasOneUse () const
 Returns true if this value has exactly one use.
bool hasNUses (unsigned n) const
 Return true if this Value has exactly n uses.
bool hasNUsesOrMore (unsigned n) const
 Return true if this value has n uses or more.
bool use_empty () const
 Returns true if this value has no uses.
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.
void printAsOperand (raw_ostream &os, const OpPrintingFlags &flags) const
voidgetAsOpaquePointer () const
 Methods for supporting PointerLikeTypeTraits.
detail::ValueImplgetImpl () const
friend::llvm::hash_code hash_value (Value arg)

Static Public Member Functions

static Value getFromOpaquePointer (const void *pointer)

Protected Attributes

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

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

◆ use_range

Definition at line 182 of file Value.h.

◆ user_iterator

◆ user_range

Definition at line 214 of file Value.h.

Constructor & Destructor Documentation

◆ Value()

Member Function Documentation

◆ dropAllUses()

void mlir::Value::dropAllUses ( )
inline

Drop all uses of this object from their respective owners.

Definition at line 144 of file Value.h.

◆ dump()

void Value::dump ( ) const

Definition at line 4070 of file AsmPrinter.cpp.

References print().

◆ getAsOpaquePointer()

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

Methods for supporting PointerLikeTypeTraits.

Definition at line 233 of file Value.h.

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

◆ getContext()

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

References result.

Referenced by mlir::affine::FlatAffineValueConstraints::addInductionVarOrTerminalSymbol(), mlir::affine::affineParallelize(), mlir::transform::TransformState::applyTransform(), mlir::linalg::areElementwiseOpsFusable(), bottomUpFromTerminatorsHeuristic(), mlir::linalg::bufferizeToAllocation(), MmaSyncBuilder::buildMmaSync(), canonicalizeAssociativeCommutativeBinaryOp(), composeSetAndOperands(), mlir::ValueBoundsConstraintSet::computeIndependentBound(), convertOmpTarget(), convertOmpThreadprivate(), mlir::nvgpu::createAsyncGroups(), createInlinedCompareImplementation(), mlir::omp::decodeCli(), defaultDeallocBufferCallBack(), mlir::detail::defaultIsEquivalentSubset(), defaultIsSmallAlloc(), delinearizeInductionVariable(), mlir::denormalizeInductionVariable(), deriveStaticUpperBound(), diagnoseInvalidOperandDominance(), doit(), mlir::DominanceInfo::dominates(), dropRefIfNoUses(), mlir::bufferization::eliminateEmptyTensors(), extractConstInteger(), FoldCopyOfCast(), foldExtractAfterInsert(), mlir::OpTrait::impl::foldIdempotent(), foldInsertAfterExtractSlice(), foldInsertUseChain(), mlir::OpTrait::impl::foldInvolution(), mlir::amdgpu::foldMemrefViewOp(), foldScalarExtractFromFromElements(), mlir::affine::fullyComposeAffineMapAndOperands(), mlir::linalg::fuseProducerOfTensor(), generateFusedElementwiseOpRegion(), get2To4PruneFlag(), mlir::vector::getAsIntegers(), mlir::getBackwardSlice(), getBase(), mlir::acc::getBaseEntity(), getCompressedMaskOp(), mlir::vector::getConstantVscaleMultiplier(), getDefiningOp(), getLoc(), getMaskFormat(), mlir::shard::getOperandShardings(), getOperandTreePredicates(), mlir::tensor::getOrCreateDestination(), getOriginalVectorValue(), getOwnerOfValue(), getParentBlock(), getParentRegion(), getRangeFromOperandShape(), getRefPtrIfDeclareTarget(), getRegisterType(), mlir::shape::getShapeVec(), mlir::shard::getSharding(), getSourceSkipUnary(), mlir::LivenessBlockInfo::getStartOperation(), getTreePredicates(), getTreePredicates(), getTreePredicates(), getTreePredicates(), getUnderlyingObjectSet(), mlir::acc::getVariableName(), getViewBase(), mlir::gpu::WarpDistributionPattern::getWarpResult(), hasAllocateSideEffect(), haveNoReadsAfterWriteExceptSameIndex(), haveSameDefiningOp(), mlir::linalg::hoistPaddingOnTensors(), mlir::linalg::hoistRedundantVectorTransfers(), mlir::inlineCall(), mlir::linalg::insertSlicesBack(), is2To4Sparsity(), mlir::sparse_tensor::isAdmissibleBranchExp(), isaInlinedFillOp(), mlir::sparse_tensor::isCertainZero(), isContiguousLoadIdx(), mlir::linalg::detail::isContractionBody(), isDeclareTargetLink(), isDefinedAsZero(), isDefinedByCallTo(), isLoopInvariantIdx(), isMaterializing(), isMaterializing(), isMulChain(), isNeutralElementConst(), isOpLoopInvariant(), mlir::affine::isTopLevelValue(), mlir::affine::isTopLevelValue(), mlir::affine::isValidDim(), mlir::affine::isValidDim(), mlir::affine::isValidSymbol(), mlir::affine::isValidSymbol(), mlir::linalg::linalgOpAnchoredEmptyTensorEliminationStep(), mlir::linalg::makeComposedPadHighOp(), mlir::makeRegionIsolatedFromAbove(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), ClampClampOptimization::matchAndRewrite(), ConcatSliceOptimization::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), PadSliceOptimization::matchAndRewrite(), SwapTransposeWithBroadcast::matchAndRewrite(), matchFullMask(), mlir::detail::matchOperandOrValueAtIndex(), mlir::matchPattern(), mayAlias(), mlir::shard::maybeInsertSourceShardingAnnotation(), mlir::dataflow::maybeReplaceWithConstant(), movePaddingToFillOrGenericOp(), mlir::moveValueDefinitions(), noAliasingUseInLoop(), mlir::linalg::offsetIndices(), mlir::outlineSingleBlockRegion(), mlir::linalg::padAndHoistLinalgOp(), padThroughLoopIterArg(), mlir::shard::partitionOperation(), performReplaceValue(), print(), print(), printOperation(), mlir::spirv::Serializer::printValueIDMap(), processParallelLoop(), mlir::ValueBoundsConstraintSet::processWorklist(), mlir::DominanceInfo::properlyDominates(), reconcileUnrealizedCastsImpl(), reifyOrComputeDynamicSizes(), relinkBranch(), remainsLegalAfterInline(), mlir::detail::ConversionPatternRewriterImpl::replaceAllUsesWith(), replaceDimOrSym(), mlir::Liveness::resolveLiveness(), mlir::linalg::rewriteAsPaddedOp(), mlir::linalg::rewriteInIm2Col(), setInsertionPointAfter(), mlir::OpBuilder::setInsertionPointAfterValue(), setInsertionPointToStart(), setLoc(), mlir::linalg::splitReduction(), mlir::linalg::splitReductionByScaling(), tracesBackToExpectedValue(), tryFoldTensors(), tryToEnforceAlignment(), unpackCast(), vectorizeOperand(), 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 125 of file Value.h.

References getDefiningOp().

◆ getFromOpaquePointer()

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

◆ getImpl()

◆ getLoc()

Location Value::getLoc ( ) const

◆ getNumUses()

unsigned Value::getNumUses ( ) const

This method computes the number of uses of this Value.

This is a linear time operation. Use hasOneUse, hasNUses, or hasNUsesOrMore to check for specific values.

Definition at line 52 of file Value.cpp.

References use_begin(), and use_end().

◆ getParentBlock()

◆ getParentRegion()

◆ getType()

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

Return the type of this value.

Definition at line 105 of file Value.h.

Referenced by addBodyWithPayloadOp(), mlir::affine::MemRefDependenceGraph::addEdge(), addExecuteResults(), adjustAccessChainForBitwidth(), mlir::allOperandsHaveSameCoopMatrixType(), appendX1Dim(), applyPad(), mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), applyToIntegerAttrs(), mlir::transform::TransformState::applyTransform(), areAllLLVMTypes(), mlir::linalg::areElementwiseOpsFusable(), assertValidValueDim(), bitAndAddrspaceCast(), bitcastSubByteVectorToI8(), bottomUpFromTerminatorsHeuristic(), broadcast(), broadcast(), broadcastDynamicDimension(), broadcastDynamicDimensions(), broadcastIfNeeded(), mlir::bufferization::func_ext::CallOpInterface::bufferize(), mlir::bufferization::impl::BufferResultsToOutParamsPassBase< DerivedT >::BufferResultsToOutParamsPassBase(), buildAvgPool2dOpWithQuantInfo(), mlir::tosa::buildConvOpResultTypeInfo(), buildDivOp(), mlir::sparse_tensor::Merger::buildExp(), mlir::tosa::buildMatMulOpQuantizationAttr(), buildMatMulOpWithQuantInfo(), MmaSyncBuilder::buildMmaSync(), buildNegateOpWithQuantInfo(), mlir::tosa::buildPadOpQuantizationAttr(), mlir::sparse_tensor::buildRelu(), buildSubAndExpOp(), mlir::tosa::buildUnaryOpQuantizationAttr(), buildVectorWrite(), calculateMemoryRequirements(), castBoolToIntN(), castIntNToBool(), castIntValueToSameSizedType(), castMFMAScaleOperand(), mlir::bufferization::castOrReallocMemRefValue(), castSameSizedTypes(), castToF32(), castToSameSizedInt(), ceilDivPositive(), ceilDivPositive(), checkLayout(), checkSymOperandList(), clampInput(), mlir::detail::TypedValue< Ty >::classof(), mlir::math::impl::MathExpandOpsPassBase< DerivedT >::classof(), collapseInnerDims(), collapseValue(), mlir::LLVM::composeValue(), mlir::ValueBoundsConstraintSet::computeBound(), mlir::linalg::computeSliceParameters(), computeTargetSize(), convertAcoshOp(), convertAsinhOp(), convertAtanhOp(), convertCeilOp(), convertCtlzOp(), mlir::complex::convertDivToLLVMUsingRangeReduction(), mlir::complex::convertDivToStandardUsingRangeReduction(), convertExp2fOp(), convertFPowIOp(), convertIntrinsicResult(), convertMFMAVectorOperand(), convertMixedValuesToInt(), convertPowfOp(), convertRoundEvenOp(), convertRoundOp(), convertRsqrtOp(), convertScalarToComplexDtype(), mlir::convertScalarToDtype(), convertScalarToFpDtype(), convertScalarToIntDtype(), convertSinhOp(), convertTanOp(), convertUnsignedToI32(), convertUnsignedToI64(), copyIntegerRange(), create4x128BitSuffle(), mlir::linalg::createAdd(), mlir::nvgpu::createAsyncGroups(), createBinarySearchFunc(), mlir::tensor::createCanonicalRankReducingInsertSliceOp(), mlir::linalg::createDestinationPassingStyleInitOperand(), mlir::tensor::createDynamicDimValues(), createExtractAndCast(), mlir::linalg::createFoldedDimOp(), createGroupReduceOp(), createGroupReduceOpImpl(), createInitialVector(), createInsertAndCast(), mlir::LLVM::detail::createIntrinsicCall(), createLinalgBodyCalculationForElementwiseOp(), mlir::arm_sme::createLoopOverTileSlices(), mlir::quant::createLowerQuantOps(), createMemcpy(), mlir::linalg::createOrFoldDimOp(), mlir::vector::createOrFoldDimOp(), createPartitionFunc(), createQuickSort(), createQuickSortFunc(), mlir::vector::createReadOrMaskedRead(), createScanLoop(), createShiftDownFunc(), createSortStableFunc(), mlir::xegpu::createXeGPUOptimizeBlockLoads(), mlir::tosa::createZPsAsConst(), mlir::omp::decodeCli(), mlir::LLVM::decomposeValue(), defaultIsSmallAlloc(), definitelyWritesOnlyWithinSlot(), delinearizeInductionVariable(), mlir::xegpu::doSCFStructuralTypeConversionWithTensorType(), doubleBuffer(), downcastSelectAndUpcast(), mlir::tensor::dropGivenUnitDims(), dropTrailingX1Dim(), dynamicallyExtractSubVector(), dynamicallyInsertSubVector(), emitElementwiseComputation(), mlir::tosa::EqualizeRanks(), expandValue(), extendMaskRank(), extendVectorRank(), extractLastDimSlice(), extractNBitsPerByteAndExtendToI8(), extractNBitsPerByteAndSignExtendToI8(), extractStructElements(), mlir::xegpu::extractVectorsWithShapeFromValue(), findAssociatedValue(), mlir::detail::ConversionPatternRewriterImpl::findOrBuildReplacementValue(), foldExtractFromBroadcast(), foldFromElementsToElements(), forwardStoreToLoad(), mlir::affine::fullyComposeAndComputeConstantDelta(), mlir::linalg::fuseProducerOfTensor(), mlir::sparse_tensor::genCast(), genCompressed(), genConditionalInsert(), genConstantDenseAddressFromLevel(), genExp(), genIf(), genInsertionLoad(), mlir::sparse_tensor::genIsNonzero(), genSliceToSize(), genStore(), genTensorStore(), getBroadcastingMap(), mlir::bufferization::OpWithUnstructuredControlFlowBufferizableOpInterfaceExternalModel< ConcreteModel, ConcreteOp >::getBufferType(), getConstantUint32(), getContext(), getConvOrPoolOutputDim(), getConvZeroPoints(), mlir::arith::impl::ArithIntRangeOptsBase< DerivedT >::getDependentDialects(), mlir::impl::LinalgDetensorizePassBase< DerivedT >::getDependentDialects(), mlir::quant::impl::LowerQuantOpsBase< DerivedT >::getDescription(), getDimValue(), mlir::xegpu::getDistributeLayoutAttr(), getEffectedValues(), mlir::getElementTypeOrSelf(), getEntryStateImpl(), mlir::ValueBoundsConstraintSet::getExpr(), getFlattenMemrefAndOffset(), getFullMemRefAsRegion(), getGenericEffectsImpl(), mlir::shard::ElementwiseShardingInterface< ElemwiseOp >::getIndexingMaps(), mlir::spirv::getIntegerDotProductCapabilities(), mlir::shard::ElementwiseShardingInterface< ElemwiseOp >::getLoopIteratorTypes(), mlir::memref::getMixedSize(), mlir::tensor::getMixedSize(), mlir::memref::getMixedSizes(), mlir::tensor::getMixedSizes(), getMultiLevelStrides(), mlir::arith::getNeutralElement(), getOffsetForBitwidth(), mlir::spirv::getOpenCLElementPtr(), getOperandTreePredicates(), mlir::tensor::getOrCreateDestination(), getRegisterType(), getReplacementValues(), getReturnTypes(), getScalarOrElementWidth(), mlir::ValueShapeRange::getShape(), getSharding(), getSlice(), mlir::sparse_tensor::getSparseTensorType(), getStorageElementTypeOrSelf(), getTreePredicates(), getTreePredicates(), mlir::detail::TypedValue< Ty >::getType(), mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::getType(), mlir::acc::getTypeCategory(), getUnusedOutOperand(), mlir::getValueOrCreateCastToIndexLike(), mlir::nvgpu::getWarpMatrixInfo(), handleArgumentImpl(), handleByValArgumentInit(), mlir::LLVM::detail::handleMultidimensionalVectors(), handleResultImpl(), inferCastResultType(), inferDynamicDimsForConv(), mlir::sparse_tensor::LoopEmitter::initialize(), mlir::inlineCall(), inlineOmpRegionCleanup(), insertCopies(), insertCopyLoops(), insertLastDimSlice(), mlir::NVVM::PtxBuilder::insertValue(), mlir::LLVM::detail::intrinsicRewrite(), isDefinedByCallTo(), mlir::OperationEquivalence::isEquivalentTo(), isGpuAsyncTokenType(), isMemref(), isMemref(), isMemref(), isNeutralElementConst(), mlir::OperationEquivalence::isRegionEquivalentTo(), mlir::BufferOriginAnalysis::isSameAllocation(), isSparseTensor(), isUniformDefinition(), mlir::affine::isValidDim(), mlir::affine::isValidDim(), mlir::affine::isValidSymbol(), mlir::affine::isValidSymbol(), isValueCompatibleWithFullReplicationSharding(), legalizeBlockArguments(), linalgBroadcastAndMaybeExt(), linalgIntBroadcastExtSIAdd(), mlir::linalg::linalgOpAnchoredEmptyTensorEliminationStep(), mlir::sparse_tensor::loadAll(), mlir::loopUnrollByFactor(), mlir::linalg::makeMemRefCopyOp(), mlir::OperandElementTypeIterator::mapElement(), mlir::ResultElementTypeIterator::mapElement(), mlir::ValueTypeIterator< iterator >::mapElement(), mlir::detail::constant_float_value_binder::match(), mlir::detail::constant_int_value_binder::match(), matchAndReplaceDepthwiseConv(), CanonicalizeContractMatmulToMMT::matchAndRewrite(), ClampClampOptimization::matchAndRewrite(), CmpFIntToFPConst::matchAndRewrite(), ConvertAccessChain::matchAndRewrite(), ConvertSameRankInsertStridedSliceIntoShuffle::matchAndRewrite(), DropUnitDimFromElementwiseOps::matchAndRewrite(), FoldBroadcasts::matchAndRewrite(), MaxPool2dIsNoOp::matchAndRewrite(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), mlir::linalg::DecomposeOuterUnitDimsPackOpPattern::matchAndRewrite(), mlir::linalg::FoldTensorCastPackOp::matchAndRewrite(), mlir::linalg::FoldTensorCastUnPackOp::matchAndRewrite(), SincosOpLowering::matchAndRewrite(), SwapTransposeWithBroadcast::matchAndRewrite(), mlir::linalg::RegionMatcher::matchAsScalarBinaryOp(), mlir::affine::materializeComputedBound(), mlir::linalg::materializeTiledShape(), mlir::OpToFuncCallLowering< SourceOp >::maybeCast(), mlir::shard::maybeInsertSourceShardingAnnotation(), mayBeRead(), mlir::dataflow::maybeReplaceWithConstant(), mlir::BufferViewFlowAnalysis::mayBeTerminalBuffer(), mlir::x86vector::avx2::inline_asm::mm256BlendPsAsm(), movePaddingToFillOrGenericOp(), needFlattening(), mlir::OperationFolder::notifyRemoval(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), optionallyTruncateOrExtend(), outlineExecuteOp(), mlir::linalg::pack(), padOperandToSmallestStaticBoundingBox(), mlir::bufferization::populateDynamicDimSizes(), mlir::affine::AffineDmaWaitOp::print(), print(), print(), printAccVar(), mlir::OpAsmPrinter::printFunctionalType(), printFunctionArgs(), printLoopControl(), printOneResultOp(), printOperation(), printScheduleClause(), printVar(), mlir::ValueBoundsConstraintSet::processWorklist(), mlir::scf::promote(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), rankReducingSubviewDroppingUnitDims(), reduce(), reduceIfNeeded(), reduceMatchAndRewriteHelper(), reifyMixedParamAndHandleResults(), reifyOrComputeDynamicSizes(), mlir::arith::reifyValueBound(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), mlir::affine::MemRefDependenceGraph::removeEdge(), mlir::scf::replaceAndCastForOpIterArg(), replaceUsesAndPropagateType(), replaceWithConstant(), mlir::linalg::DownscaleConv2DOp::returningMatchAndRewrite(), mlir::linalg::DownscaleDepthwiseConv2DNhwcHwcOp::returningMatchAndRewrite(), mlir::linalg::DownscaleSizeOneWindowed2DConvolution< Conv2DOp, Conv1DOp >::returningMatchAndRewrite(), mlir::linalg::rewriteAsPaddedOp(), mlir::linalg::rewriteAsPaddedOp(), rewriteI2ToI8Ext(), rewriteI4ToI8Ext(), rewriteI8ToI4Trunc(), mlir::linalg::rewriteInIm2Col(), mlir::linalg::rewriteInIm2Col(), mlir::linalg::rewriteInIm2Col(), mlir::linalg::rewriteInIm2Col(), setInPlaceOpOperand(), mlir::sparse_tensor::SparseTensorSpecifier::setSpecifierField(), shiftValue(), mlir::linalg::splitReduction(), mlir::linalg::splitReductionByScaling(), staticallyExtractSubvector(), staticallyInsertSubvector(), mlir::sparse_tensor::storeAll(), mlir::transform::ErrorCheckingTrackingListener::TrackingListener(), mlir::linalg::transposeBatchMatmul(), mlir::linalg::transposeMatmul(), transposeOneLinalgOperandAndReplace(), transposeToShuffle16x16(), truncOrExtToLLVMType(), truncToI32(), mlir::sparse_tensor::tryGetSparseTensorType(), unpackOperandVector(), unpackSingleIndexResultPayloadOperations(), unpackSingleIndexResultPayloadOperations(), mlir::vector::unrollVectorOp(), mlir::ValueBoundsConstraintSet::Variable::Variable(), vectorizeOneOp(), vectorizeOperand(), vectorizeTensorExtract(), vectorizeUniform(), vectorShape(), verifyAllToAllOperandAndResultShape(), mlir::spirv::verifyAtomicUpdateOp(), verifyAttributions(), verifyBlockReadWritePtrAndValTypes(), mlir::detail::verifyBranchSuccessorOperands(), mlir::spirv::verifyCastOp(), mlir::LLVM::detail::verifyDereferenceableOpInterface(), verifyGatherOperandAndResultShape(), verifyInitializationAttribute(), verifyInitLikeSingleArgRegion(), mlir::spirv::verifyIntegerDotProduct(), mlir::spirv::verifyLoadStorePtrAndValTypes(), mlir::detail::verifyMemorySpaceCastOpInterface(), verifyNumBlockArgs(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), verifyReductionVarList(), verifyRescaleValueAndZpTypes(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), mlir::OpTrait::impl::verifySameTypeOperands(), verifyScatterOrSliceOperandAndResultShape(), mlir::detail::verifyShapedDimOpInterface(), verifyShiftOp(), mlir::linalg::detail::verifyStructuredOpInterface(), mlir::transform::AtMostOneOpMatcherOpTrait< OpTy >::verifyTrait(), mlir::transform::SingleValueMatcherOpTrait< OpTy >::verifyTrait(), verifyYield(), visitUpward(), wmmaPushInputOperand(), wmmaPushOutputOperand(), and wrapExternalFunction().

◆ getUsers()

◆ getUses()

◆ hash_value()

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

References Value().

◆ hasNUses()

bool Value::hasNUses ( unsigned n) const

Return true if this Value has exactly n uses.

Definition at line 56 of file Value.cpp.

References use_begin(), and use_end().

◆ hasNUsesOrMore()

bool Value::hasNUsesOrMore ( unsigned n) const

Return true if this value has n uses or more.

This is logically equivalent to getNumUses() >= N.

Definition at line 60 of file Value.cpp.

References use_begin(), and use_end().

◆ hasOneUse()

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

◆ isUsedOutsideOfBlock()

bool Value::isUsedOutsideOfBlock ( Block * block) const

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

Definition at line 99 of file Value.cpp.

References mlir::Operation::getBlock(), and getUsers().

◆ operator bool()

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

Definition at line 100 of file Value.h.

◆ operator!=()

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

Definition at line 102 of file Value.h.

References Value().

◆ operator==()

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

Definition at line 101 of file Value.h.

References impl, and Value().

◆ print() [1/3]

void Value::print ( raw_ostream & os) const

Definition at line 4041 of file AsmPrinter.cpp.

References print().

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

◆ print() [2/3]

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

◆ print() [3/3]

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

◆ printAsOperand() [1/2]

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

Print this value as if it were an operand.

Definition at line 4075 of file AsmPrinter.cpp.

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

Referenced by annotateOpsWithAliasSets(), mlirValuePrintAsOperand(), and printAsOperand().

◆ printAsOperand() [2/2]

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

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

References getUses(), and Value().

Referenced by mlirValueReplaceAllUsesExcept().

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

References getUses(), and Value().

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

References Value().

Referenced by forwardStoreToLoad(), mlir::inlineCall(), legalizeBlockArguments(), 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 91 of file Value.cpp.

References getUses(), and Value().

Referenced by maybeInsertTargetShardingAnnotationImpl(), and mlir::outlineSingleBlockRegion().

◆ setLoc()

void Value::setLoc ( Location loc)

Definition at line 31 of file Value.cpp.

References getDefiningOp().

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

Referenced by mlir::xegpu::doSCFStructuralTypeConversionWithTensorType(), reifyOpResultShapes(), and 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 106 of file Value.cpp.

References getImpl(), indices, and mlir::IRObjectWithUseList< OperandType >::shuffleUseList().

◆ use_begin()

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

Definition at line 184 of file Value.h.

Referenced by getNumUses(), getUses(), hasNUses(), hasNUsesOrMore(), mlirValueGetFirstUse(), and user_begin().

◆ use_empty()

◆ use_end()

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

Definition at line 185 of file Value.h.

Referenced by getNumUses(), getUses(), hasNUses(), hasNUsesOrMore(), and user_end().

◆ user_begin()

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

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

References use_end().

Referenced by getUsers().

Member Data Documentation

◆ impl

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

A pointer to the internal implementation of the value.

Definition at line 243 of file Value.h.

Referenced by operator==().


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