MLIR
20.0.0git
|
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"
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 > | |
U | dyn_cast () const |
template<typename U > | |
U | dyn_cast_or_null () const |
template<typename U > | |
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... | |
MLIRContext * | getContext () 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... | |
Operation * | getDefiningOp () 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) |
Region * | getParentRegion () |
Return the Region in which this Value is defined. More... | |
Block * | getParentBlock () |
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::ValueImpl * | getImpl () const |
Static Public Member Functions | |
static Value | getFromOpaquePointer (const void *pointer) |
Protected Attributes | |
detail::ValueImpl * | impl |
A pointer to the internal implementation of the value. More... | |
Friends | |
::llvm::hash_code | hash_value (Value arg) |
Make Value hashable. More... | |
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).
|
inlineconstexpr |
|
inline |
void Value::dump | ( | ) | const |
Definition at line 3954 of file AsmPrinter.cpp.
References print().
|
inline |
|
inline |
|
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().
|
inline |
Utility to get the associated MLIRContext that this value is defined in.
Definition at line 132 of file Value.h.
References mlir::Type::getContext(), and getType().
Referenced by mlir::scf::addLoopRangeConstraints(), annotateNonWritableTensor(), areAllIndicesI32(), calculateMemoryRequirements(), mlir::ValueBoundsConstraintSet::computeConstantDelta(), mlir::vector::ScalableValueBoundsConstraintSet::computeScalableBound(), dropRefIfNoUses(), mlir::affine::fullyComposeAndComputeConstantDelta(), getSharding(), inferCastResultType(), isAccessIndexInvariant(), and maybeConstantDimsAttr().
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(), canonicalizeAssociativeCommutativeBinaryOp(), checkAssumptionForFusingConsumer(), composeSetAndOperands(), mlir::ValueBoundsConstraintSet::computeIndependentBound(), convertOmpTarget(), convertOmpThreadprivate(), mlir::nvgpu::createAsyncGroups(), createInlinedCompareImplementation(), defaultDeallocBufferCallBack(), mlir::detail::defaultIsEquivalentSubset(), defaultIsSmallAlloc(), mlir::denormalizeInductionVariable(), deriveStaticUpperBound(), diagnoseInvalidOperandDominance(), distinctAllocAndBlockArgument(), mlir::DominanceInfo::dominates(), mlir::bufferization::dropEquivalentBufferResults(), dropRefIfNoUses(), mlir::bufferization::AnalysisState::findValueInReverseUseDefChain(), foldExtractAfterInsertSlice(), mlir::OpTrait::impl::foldIdempotent(), foldInsertAfterExtractSlice(), mlir::OpTrait::impl::foldInvolution(), foldScalarExtractFromFromElements(), mlir::affine::fullyComposeAffineMapAndOperands(), mlir::linalg::fuseProducerOfTensor(), generateFusedElementwiseOpRegion(), get2To4PruneFlag(), mlir::vector::getAsIntegers(), mlir::getBackwardSlice(), getBase(), mlir::bufferization::getBuffer(), getCompressedMaskOp(), mlir::vector::getConstantVscaleMultiplier(), getDefiningOp(), getMaskFormat(), mlir::mesh::getMeshSharding(), mlir::mesh::getOperandShardings(), getOperandTreePredicates(), mlir::tensor::getOrCreateDestination(), getOwnerOfValue(), getProducerOfTensor(), getRangeFromOperandShape(), getRefPtrIfDeclareTarget(), getRegisterType(), mlir::shape::getShapeVec(), getSourceSkipUnary(), mlir::LivenessBlockInfo::getStartOperation(), getTreePredicates(), getUnderlyingObjectSet(), getViewBase(), mlir::gpu::WarpDistributionPattern::getWarpResult(), hasAllocateSideEffect(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), haveNoReadsAfterWriteExceptSameIndex(), mlir::linalg::hoistPaddingOnTensors(), mlir::sparse_tensor::LoopEmitter::initializeLoopEmit(), mlir::inlineCall(), mlir::linalg::insertSlicesBack(), is2To4Sparsity(), mlir::sparse_tensor::isAdmissibleBranchExp(), mlir::sparse_tensor::isCertainZero(), isContiguousLoadIdx(), mlir::linalg::detail::isContractionBody(), isDeclareTargetLink(), isDefinedAsZero(), isDefinedByCallTo(), isEscapingMemref(), isLocallyDefined(), isLoopInvariantIdx(), isMaterializing(), isMulChain(), isOpLoopInvariant(), mlir::affine::isTopLevelValue(), mlir::affine::isValidDim(), mlir::affine::isValidSymbol(), mlir::affine::loopUnrollJamByFactor(), mlir::linalg::makeComposedPadHighOp(), mlir::makeRegionIsolatedFromAbove(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), FoldAddIntoDest::matchAndRewrite(), SwapTransposeWithBroadcast::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), ClampClampOptimization::matchAndRewrite(), ConcatSliceOptimization::matchAndRewrite(), mlir::linalg::LinalgCopyVTRForwardingPattern::matchAndRewrite(), mlir::linalg::LinalgCopyVTWForwardingPattern::matchAndRewrite(), mlir::detail::matchOperandOrValueAtIndex(), mlir::matchPattern(), mayAlias(), mlir::mesh::maybeInsertSourceShardingAnnotation(), maybeReplaceWithConstant(), mlir::mesh::MeshSharding::MeshSharding(), movePaddingToFillOrGenericOp(), noAliasingUseInLoop(), mlir::linalg::offsetIndices(), mlir::bufferization::ValueComparator::operator()(), mlir::outlineSingleBlockRegion(), mlir::linalg::padAndHoistLinalgOp(), padThroughLoopIterArg(), CommutativeOperand::popFrontAndPushAdjacentUnvisitedAncestors(), printOperation(), mlir::spirv::Serializer::printValueIDMap(), processParallelLoop(), mlir::ValueBoundsConstraintSet::processWorklist(), mlir::DominanceInfo::properlyDominates(), reifyOrComputeDynamicSizes(), relinkBranch(), remainsLegalAfterInline(), replaceDimOrSym(), mlir::Liveness::resolveLiveness(), mlir::linalg::rewriteInDestinationPassingStyle(), setInsertionPointAfter(), mlir::OpBuilder::setInsertionPointAfterValue(), setInsertionPointToStart(), mlir::linalg::splitReduction(), mlir::linalg::splitReductionByScaling(), tracesBackToExpectedValue(), tryFoldTensors(), tryToEnforceAlignment(), unpackCast(), mlir::detail::ConversionPatternRewriterImpl::unpackNTo1Materialization(), mlir::spirv::verifyGroupNonUniformArithmeticOp(), and visitUpward().
|
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().
|
inlinestatic |
Definition at line 244 of file Value.h.
Referenced by llvm::DenseMapInfo< mlir::Value >::getEmptyKey(), llvm::PointerLikeTypeTraits< mlir::Value >::getFromVoidPointer(), and llvm::DenseMapInfo< mlir::Value >::getTombstoneKey().
|
inline |
Definition at line 247 of file Value.h.
References impl.
Referenced by mlir::BlockArgument::classof(), mlir::OpResult::classof(), llvm::CastInfo< To, From, std::enable_if_t< std::is_same_v< mlir::Value, std::remove_const_t< From > >||std::is_base_of_v< mlir::Value, From > > >::doCast(), and mlir::OpOperand::getUseList().
Location Value::getLoc | ( | ) | const |
Return the location of this value.
Definition at line 26 of file Value.cpp.
Referenced by addAtomicRMW(), mlir::transform::gpu::alterGpuLaunch(), mlir::transform::TransformState::applyTransform(), buildLoopIterationCount(), buildPredicateList(), mlir::bufferization::castOrReallocMemRefValue(), castToCompatibleMemRefType(), mlir::OneToNTypeMapping::convertLocation(), mlir::linalg::copyToGPUPrivateMemory(), mlir::linalg::copyToWorkgroupMemory(), createDecl(), createSwitchOp(), dispatchMappedValues(), dropRefIfNoUses(), mlir::detail::ConversionPatternRewriterImpl::findOrBuildReplacementValue(), genDemap(), genRemap(), mlir::bufferization::getBuffer(), mlir::bufferization::DeallocationState::getMemrefWithUniqueOwnership(), mlir::vector::getVectorReductionOp(), mlir::OperationEquivalence::isRegionEquivalentTo(), mlir::mesh::maybeInsertSourceShardingAnnotation(), mlir::mesh::maybeInsertTargetShardingAnnotation(), maybeReplaceWithConstant(), mlirAsmStateCreateForValue(), movePaddingToFillOrGenericOp(), mlir::detail::ConversionPatternRewriterImpl::notifyOpReplaced(), mlir::transform::ErrorCheckingTrackingListener::notifyPayloadReplacementNotFound(), padThroughLoopIterArg(), reifyOrComputeDynamicSizes(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), mlir::bufferization::replaceOpWithBufferizedValues(), mlir::linalg::rewriteInIm2Col(), verifyAllToAllOperandAndResultShape(), verifyGatherOperandAndResultShape(), and verifyScatterOrSliceOperandAndResultShape().
Block * Value::getParentBlock | ( | ) |
Return the Block in which this Value is defined.
Definition at line 48 of file Value.cpp.
Referenced by mlir::LocalAliasAnalysis::aliasImpl(), computeInsertPoint(), destructureSlot(), dropRefIfNoUses(), mlir::bufferization::findCommonDominator(), mlir::linalg::fuseProducerOfTensor(), genExp(), mlir::bufferization::DeallocationState::getMemrefWithUniqueOwnership(), setInsertionPointToStart(), tryToEnforceAlignment(), and mlir::bufferization::DeallocationState::updateOwnership().
Region * Value::getParentRegion | ( | ) |
Return the Region in which this Value is defined.
Definition at line 41 of file Value.cpp.
References mlir::Region::getParentRegion().
Referenced by mlir::LocalAliasAnalysis::aliasImpl(), mlir::getEnclosingRepetitiveRegion(), mlir::bufferization::AnalysisState::getEnclosingRepetitiveRegion(), handleByValArgumentInit(), hasAllocationScope(), insertCopyLoops(), mlir::transform::TransformState::mapBlockArguments(), and maybeReplaceWithConstant().
|
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(), adjustAccessChainForBitwidth(), mlir::bufferization::allocateTensorForShapedValue(), mlir::allOperandsHaveSameCoopMatrixType(), appendX1Dim(), applyPad(), mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), applyToIntegerAttrs(), mlir::transform::TransformState::applyTransform(), areAllLLVMTypes(), mlir::linalg::areElementwiseOpsFusable(), assertValidValueDim(), bitAndAddrspaceCast(), broadcast(), broadcastDynamicDimension(), broadcastDynamicDimensions(), broadcastIfNeeded(), mlir::bufferization::func_ext::CallOpInterface::bufferize(), 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(), ceilDivPositive(), checkLayout(), checkSymOperandList(), clampInput(), mlir::detail::TypedValue< Ty >::classof(), collapseInnerDims(), collapseOperandsAndResults(), mlir::linalg::collapseOpIterationDims(), collapseValue(), mlir::ValueBoundsConstraintSet::computeBound(), mlir::linalg::computeSliceParameters(), computeTargetSize(), convertAcoshOp(), convertAsinhOp(), convertAtanhOp(), convertCeilOp(), convertCoshOp(), convertExp2fOp(), convertFloorOp(), convertFPowIOp(), convertIntrinsicResult(), convertMFMAVectorOperand(), convertPowfOp(), convertRoundOp(), convertScalarToComplexDtype(), mlir::convertScalarToDtype(), convertScalarToFpDtype(), convertScalarToIntDtype(), convertSinhOp(), convertTanOp(), convertToLaunchFuncOp(), copyIntegerRange(), create4x128BitSuffle(), mlir::linalg::createAdd(), mlir::AllocationOpLLVMLowering::createAligned(), mlir::nvgpu::createAsyncGroups(), createBinarySearchFunc(), mlir::tensor::createCanonicalRankReducingExtractSliceOp(), mlir::tensor::createCanonicalRankReducingInsertSliceOp(), mlir::memref::createCanonicalRankReducingSubViewOp(), createContractArithOp(), createDecl(), mlir::linalg::createDestinationPassingStyleInitOperand(), mlir::tensor::createDynamicDimValues(), mlir::emitc::createExpression(), createExtractAndCast(), mlir::linalg::createFoldedDimOp(), createFullPartialVectorTransferRead(), createGroupReduceOp(), createGroupReduceOpImpl(), createInsertAndCast(), mlir::LLVM::detail::createIntrinsicCall(), createLinalgBodyCalculationForElementwiseOp(), 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(), createSortStableFunc(), createSubViewIntersection(), createTruncatedFPValue(), createWriteOrMaskedWrite(), declareReduction(), mlir::bufferization::detail::defaultGetBufferType(), defaultIsSmallAlloc(), definitelyWritesOnlyWithinSlot(), delinearizeInductionVariable(), dispatchMappedValues(), doubleBuffer(), mlir::bufferization::dropEquivalentBufferResults(), dropTrailingX1Dim(), emitElementwiseComputation(), ensureToMemrefOpIsValid(), mlir::tosa::EqualizeRanks(), expandRank(), expandValue(), extendMaskRank(), extendVectorRank(), extractLastDimSlice(), findAssociatedValue(), mlir::detail::ConversionPatternRewriterImpl::findOrBuildReplacementValue(), mlir::bufferization::AnalysisState::findValueInReverseUseDefChain(), flattenVecToBits(), foldExtractFromBroadcast(), foreachIndividualVectorElement(), forwardStoreToLoad(), mlir::affine::fullyComposeAndComputeConstantDelta(), mlir::linalg::fuseProducerOfTensor(), genBuffers(), mlir::sparse_tensor::genCast(), genCompressed(), genConditionalInsert(), genConstantDenseAddressFromLevel(), generatePointWiseCopy(), genExp(), genExpand(), genIf(), mlir::sparse_tensor::genIndexLoad(), genInsertionLoad(), mlir::sparse_tensor::genIsNonzero(), genResult(), genSliceOffset(), genSliceStride(), genSliceToSize(), genStore(), genTensorLoad(), genTensorStore(), mlir::sparse_tensor::genToMemref(), mlir::AllocationOpLLVMLowering::getAlignment(), getBroadcastingMap(), mlir::bufferization::getBuffer(), mlir::getBufferizationOptionsForSparsification(), mlir::bufferization::OpWithUnstructuredControlFlowBufferizableOpInterfaceExternalModel< ConcreteModel, ConcreteOp >::getBufferType(), mlir::bufferization::getBufferType(), getCollapsedOpOperand(), getConstantUint32(), getContext(), getConvOrPoolOutputDim(), getDimValue(), mlir::MemRefDescriptor::getElementPtrType(), mlir::getElementTypeOrSelf(), mlir::ValueBoundsConstraintSet::getExpr(), getFlatOffsetAndStrides(), getFullMemRefAsRegion(), getGenericEffectsImpl(), mlir::mesh::ElementwiseShardingInterface< ElemwiseOp >::getIndexingMaps(), mlir::spirv::getIntegerDotProductCapabilities(), mlir::mesh::ElementwiseShardingInterface< ElemwiseOp >::getLoopIteratorTypes(), mlir::IntegerValueRange::getMaxRange(), mlir::AllocationOpLLVMLowering::getMemRefResultType(), mlir::bufferization::getMemRefType(), mlir::memref::getMixedSize(), mlir::tensor::getMixedSize(), mlir::memref::getMixedSizes(), mlir::tensor::getMixedSizes(), getMultiLevelStrides(), mlir::arith::getNeutralElement(), getNumNonTrivialIdxExpOnSparseLvls(), getOffsetForBitwidth(), mlir::spirv::getOpenCLElementPtr(), getOperandTreePredicates(), mlir::tensor::getOrCreateDestination(), getOrFoldTensorDim(), getProducerOfTensor(), mlir::xegpu::getRankOf(), getRegisterType(), getReshapeOutputShapeFromInputShape(), getReturnTypes(), getScalarOrElementWidth(), mlir::ValueShapeRange::getShape(), getSharding(), getSlice(), mlir::sparse_tensor::getSparseTensorType(), getTreePredicates(), mlir::detail::TypedValue< Ty >::getType(), mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::getType(), getUnusedOutOperand(), mlir::getValueOrCreateCastToIndexLike(), mlir::nvgpu::getWarpMatrixInfo(), handleArgumentImpl(), handleByValArgumentInit(), mlir::LLVM::detail::handleMultidimensionalVectors(), handleResultImpl(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), inferCastResultType(), inferDynamicDimsForConv(), mlir::sparse_tensor::LoopEmitter::initialize(), mlir::sparse_tensor::LoopEmitter::initializeLoopEmit(), mlir::inlineCall(), inlineOmpRegionCleanup(), insertCopies(), insertCopyLoops(), insertLastDimSlice(), mlir::detail::ConversionPatternRewriterImpl::insertNTo1Materialization(), 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(), legalizeBlockArguments(), linalgBroadcastAndMaybeExtSI(), linalgIntBroadcastExtSIAdd(), mlir::sparse_tensor::loadAll(), mlir::loopUnrollByFactor(), mlir::linalg::makeMemRefCopyOp(), mlir::ValueTypeIterator< ValueIteratorT >::mapElement(), mlir::OperandElementTypeIterator::mapElement(), mlir::ResultElementTypeIterator::mapElement(), mlir::detail::constant_float_value_binder::match(), mlir::detail::constant_int_value_binder::match(), matchAndReplaceDepthwiseConv(), CmpFIntToFPConst::matchAndRewrite(), FoldTensorCastProducerOp::matchAndRewrite(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), ConvertSameRankInsertStridedSliceIntoShuffle::matchAndRewrite(), SwapTransposeWithBroadcast::matchAndRewrite(), MulExtendedFold< MulOp, IsSigned >::matchAndRewrite(), FoldTensorCastPackOp::matchAndRewrite(), ConvertAccessChain::matchAndRewrite(), IAddCarryFold::matchAndRewrite(), UMulExtendedOpXOne::matchAndRewrite(), MaxPool2dIsNoOp::matchAndRewrite(), mlir::linalg::RegionMatcher::matchAsScalarBinaryOp(), mlir::affine::materializeComputedBound(), mlir::linalg::materializeTiledShape(), maybeReplaceWithConstant(), mlir::BufferViewFlowAnalysis::mayBeTerminalBuffer(), mlir::MemRefDescriptor::MemRefDescriptor(), mlir::x86vector::avx2::inline_asm::mm256BlendPsAsm(), movePaddingToFillOrGenericOp(), mlir::ArithBuilder::mul(), needFlatten(), mlir::affine::normalizeMemRef(), mlir::detail::ConversionPatternRewriterImpl::notifyOpReplaced(), mlir::OperationFolder::notifyRemoval(), SliceCanonicalizer::operator()(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), optionallyTruncateOrExtend(), outlineExecuteOp(), mlir::linalg::pack(), padOperandToSmallestStaticBoundingBox(), mlir::bufferization::populateDynamicDimSizes(), printAttributions(), mlir::OpAsmPrinter::printFunctionalType(), printFunctionArgs(), printLoopControl(), printOneResultOp(), printOperation(), printScheduleClause(), mlir::ValueBoundsConstraintSet::processWorklist(), mlir::scf::promote(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), rankReducingSubviewDroppingUnitDims(), reduce(), reduceIfNeeded(), reduceMatchAndRewriteHelper(), reifyOrComputeDynamicSizes(), mlir::arith::reifyValueBound(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), mlir::affine::MemRefDependenceGraph::removeEdge(), mlir::affine::replaceAllMemRefUsesWith(), mlir::scf::replaceAndCastForOpIterArg(), mlir::bufferization::replaceOpWithBufferizedValues(), 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::impl::scalarizeVectorOp(), setInPlaceOpOperand(), mlir::sparse_tensor::SparseTensorSpecifier::setSpecifierField(), mlir::ArithBuilder::sgt(), shiftValue(), mlir::ArithBuilder::slt(), mlir::sparse_tensor::IterationGraphSorter::sort(), mlir::vector::splitFullAndPartialTransfer(), mlir::linalg::splitReduction(), mlir::linalg::splitReductionByScaling(), staticallyExtractSubvector(), staticallyInsertSubvector(), mlir::sparse_tensor::storeAll(), mlir::ArithBuilder::sub(), transformMemRefLoadWithReducedRank(), mlir::linalg::transposeBatchMatmul(), mlir::linalg::transposeMatmul(), transposeOneLinalgOperandAndReplace(), truncToI32(), mlir::sparse_tensor::tryGetSparseTensorType(), unpackOperandVector(), updateCalls(), mlir::ValueBoundsConstraintSet::Variable::Variable(), vectorizeDynamicConvOpPrecondition(), vectorShape(), verifyAllToAllOperandAndResultShape(), mlir::spirv::verifyAtomicUpdateOp(), verifyBlockReadWritePtrAndValTypes(), mlir::detail::verifyBranchSuccessorOperands(), mlir::spirv::verifyCastOp(), mlir::detail::verifyDestinationStyleOpInterface(), verifyGatherOperandAndResultShape(), verifyInitializationAttribute(), verifyInitLikeSingleArgRegion(), mlir::spirv::verifyIntegerDotProduct(), mlir::spirv::verifyLoadStorePtrAndValTypes(), verifyNumBlockArgs(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), verifyReductionVarList(), 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().
|
inline |
Definition at line 228 of file Value.h.
References user_begin(), and user_end().
Referenced by mlir::memref::findDealloc(), mlir::detail::ConversionPatternRewriterImpl::findOrBuildReplacementValue(), mlir::LivenessBlockInfo::getEndOperation(), mlir::getForwardSlice(), mlir::mesh::getMeshSharding(), mlir::mesh::getResultShardings(), hasNonAffineUsersOnPath(), isEscapingMemref(), isLoadFromGlobalStoredToShared(), isOpLoopInvariant(), mlir::affine::isOpwiseShiftValid(), isSpMMCusparseLtOp(), TransposeIsReshape::matchAndRewrite(), mlir::matchReduction(), maybeCaptured(), noAliasingUseInLoop(), mlir::affine::normalizeMemRef(), mlir::affine::replaceAllMemRefUsesWith(), replaceForAllWithNewSignature(), shouldBeInlined(), tileAndFuseFirstExtractUseThroughContainingOpBlockArgument(), mlir::dataflow::IntegerRangeAnalysis::visitNonControlFlowArguments(), and mlir::dataflow::IntegerRangeAnalysis::visitOperation().
|
inline |
Returns a range of all uses, which is useful for iterating over all uses.
Definition at line 212 of file Value.h.
References use_begin(), and use_end().
Referenced by checkAssumptionForFusingConsumer(), checkDoubleConsume(), computeDestructuringInfo(), dropRefIfNoUses(), getConsumerFromLoopUses(), getSingleTerminatorUse(), getSubViewUseIfUnique(), getUntiledConsumerFromSlice(), mlir::bufferization::AnalysisState::isValueRead(), mlir::bufferization::OneShotAnalysisState::isValueWritten(), mlir::linalg::LinalgCopyVTRForwardingPattern::matchAndRewrite(), mlir::mesh::maybeInsertTargetShardingAnnotation(), processValue(), mlir::replaceAllUsesInRegionWith(), mlir::RewriterBase::replaceAllUsesWith(), mlir::RewriterBase::replaceUsesWithIf(), and mlir::Liveness::resolveLiveness().
|
inline |
Returns true if this value has exactly one use.
Definition at line 215 of file Value.h.
Referenced by mlir::mesh::getMeshSharding(), mlir::mesh::getResultShardings(), getSingleTerminatorUse(), mlir::linalg::hoistRedundantVectorBroadcasts(), isLoadFromGlobalStoredToShared(), isResultValueDead(), SwapTransposeWithBroadcast::matchAndRewrite(), mlir::matchReduction(), and shouldBeInlined().
|
inline |
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().
|
inlineexplicit |
|
inline |
|
inline |
void Value::print | ( | raw_ostream & | os | ) | const |
Definition at line 3925 of file AsmPrinter.cpp.
Referenced by mlir::operator<<(), and mlir::Diagnostic::operator<<().
void Value::print | ( | raw_ostream & | os, |
AsmState & | state | ||
) | const |
Definition at line 3939 of file AsmPrinter.cpp.
void Value::print | ( | raw_ostream & | os, |
const OpPrintingFlags & | flags | ||
) | const |
Definition at line 3926 of file AsmPrinter.cpp.
void Value::printAsOperand | ( | raw_ostream & | os, |
AsmState & | state | ||
) | const |
Print this value as if it were an operand.
Definition at line 3959 of file AsmPrinter.cpp.
void Value::printAsOperand | ( | raw_ostream & | os, |
const OpPrintingFlags & | flags | ||
) | const |
Definition at line 3984 of file AsmPrinter.cpp.
References findParent(), mlir::OpResult::getOwner(), mlir::Operation::getParentOp(), and mlir::OpPrintingFlags::shouldUseLocalScope().
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.
Referenced by mlirValueReplaceAllUsesExcept(), and mlir::affine::normalizeAffineParallel().
|
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 mlir::emitc::createExpression(), forwardStoreToLoad(), mlir::inlineCall(), legalizeBlockArguments(), loadCSE(), mlir::affine::normalizeMemRef(), mlir::OpTrait::OneResult< ConcreteType >::replaceAllUsesWith(), and replaceWithConstant().
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().
|
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().
void Value::shuffleUseList | ( | ArrayRef< unsigned > | indices | ) |
|
inline |
Definition at line 208 of file Value.h.
Referenced by getUses(), mlirValueGetFirstUse(), and user_begin().
|
inline |
Returns true if this value has no uses.
Definition at line 218 of file Value.h.
Referenced by computeDestructuringInfo(), destructureSlot(), generateUnrolledLoop(), isResultValueDead(), mlir::affine::loopUnrollJamByFactor(), mlir::loopUnrollJamByFactor(), maybeReplaceWithConstant(), mlirValueGetFirstUse(), mlir::tryToPromoteMemorySlots(), and mlir::ResultRange::use_empty().
|
inline |
Definition at line 209 of file Value.h.
Referenced by getUses(), and user_end().
|
inline |
Definition at line 226 of file Value.h.
References use_begin().
Referenced by getUsers(), and isResultValueDead().
|
inline |
|
friend |
|
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==().