MLIR
18.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 () 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... | |
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) |
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... | |
void | printAsOperand (raw_ostream &os, const OpPrintingFlags &flags) |
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).
|
inlineconstexpr |
|
inline |
|
inline |
void Value::dump | ( | ) |
Definition at line 3808 of file AsmPrinter.cpp.
References print().
|
inline |
|
inline |
|
inline |
Methods for supporting PointerLikeTypeTraits.
Definition at line 237 of file Value.h.
References impl.
Referenced by llvm::PointerLikeTypeTraits< mlir::Value >::getAsVoidPointer().
|
inline |
Utility to get the associated MLIRContext that this value is defined in.
Definition at line 125 of file Value.h.
References mlir::Type::getContext(), and getType().
Referenced by mlir::scf::addLoopRangeConstraints(), annotateNonWritableTensor(), areAllIndicesI32(), mlir::ValueBoundsConstraintSet::areEqual(), mlir::ValueBoundsConstraintSet::computeBound(), mlir::ValueBoundsConstraintSet::computeConstantBound(), dropRefIfNoUses(), 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::linalg::areElementwiseOpsFusable(), MmaSyncBuilder::buildMmaSync(), composeSetAndOperands(), computeNecessaryMaterializations(), convertOmpThreadprivate(), createInlinedCompareImplementation(), defaultDeallocBufferCallBack(), defaultIsSmallAlloc(), mlir::DominanceInfo::dominates(), mlir::bufferization::dropEquivalentBufferResults(), mlir::bufferization::AnalysisState::findValueInReverseUseDefChain(), foldExtractAfterInsertSlice(), foldInsertAfterExtractSlice(), mlir::affine::fullyComposeAffineMapAndOperands(), mlir::linalg::fuseProducerOfTensor(), generateFusedElementwiseOpRegion(), genSplitSparseConstant(), get2To4PruneFlag(), mlir::vector::getAsIntegers(), mlir::getBackwardSlice(), getBase(), mlir::bufferization::getBuffer(), getDefiningOp(), getLoopInvariantInsertSliceDefining(), getLoopInvariantTransferWriteDefining(), getMaskFormat(), getOperandTreePredicates(), mlir::tensor::getOrCreateDestination(), getOwnerOfValue(), getProducerOfTensor(), getRangeFromOperandShape(), getRefPtrIfDeclareTarget(), mlir::shape::getShapeVec(), mlir::LivenessBlockInfo::getStartOperation(), getTreePredicates(), mlir::sparse_tensor::getTuple(), getUnderlyingObject(), getUnderlyingObjectSet(), getWarpResult(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), mlir::linalg::hoistPaddingOnTensors(), mlir::sparse_tensor::LoopEmitter::initializeLoopEmit(), isContiguousLoadIdx(), mlir::linalg::detail::isContractionBody(), isDefinedByCallTo(), isElementTypeInconsistent(), isEscapingMemref(), isLocallyDefined(), isLoopInvariantIdx(), isMaterializing(), isMulChain(), mlir::affine::isTopLevelValue(), mlir::affine::isValidDim(), mlir::affine::isValidSymbol(), mlir::isZeroIndex(), mlir::linalg::makeComposedPadHighOp(), mlir::makeRegionIsolatedFromAbove(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), mlir::LLVM::SplitStores::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), ConcatSliceOptimization::matchAndRewrite(), mlir::linalg::LinalgCopyVTRForwardingPattern::matchAndRewrite(), mlir::linalg::LinalgCopyVTWForwardingPattern::matchAndRewrite(), mayAlias(), movePaddingToFillOrGenericOp(), noAliasingUseInLoop(), mlir::linalg::offsetIndices(), mlir::bufferization::ValueComparator::operator()(), mlir::outlineSingleBlockRegion(), mlir::linalg::padAndHoistLinalgOp(), padThroughLoopIterArg(), CommutativeOperand::popFrontAndPushAdjacentUnvisitedAncestors(), processParallelLoop(), mlir::ValueBoundsConstraintSet::processWorklist(), mlir::DominanceInfo::properlyDominates(), reifyOrComputeDynamicSizes(), remainsLegalAfterInline(), replaceDimOrSym(), mlir::Liveness::resolveLiveness(), mlir::linalg::rewriteInDestinationPassingStyle(), setInsertionPointAfter(), setInsertionPointToStart(), tracesBackToExpectedValue(), tryToEnforceAlignment(), GenericPadOpVectorizationPattern::tryVectorizeCopy(), mlir::bufferization::detail::unknownGetAliasingOpOperands(), 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 142 of file Value.h.
References getDefiningOp().
|
inlinestatic |
Definition at line 238 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 241 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(), mlir::OpOperand::getUseList(), and mlir::RewriterBase::replaceAllUsesWith().
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(), buildLoopIterationCount(), buildPredicateList(), mlir::bufferization::castOrReallocMemRefValue(), castToCompatibleMemRefType(), mlir::OneToNTypeMapping::convertLocation(), mlir::linalg::copyToGPUPrivateMemory(), mlir::linalg::copyToWorkgroupMemory(), createDecl(), createSwitchOp(), mlir::bufferization::getBuffer(), getLoopInvariantInsertSliceDefining(), getLoopInvariantTransferWriteDefining(), mlir::bufferization::DeallocationState::getMemrefWithUniqueOwnership(), mlir::OperationEquivalence::isRegionEquivalentTo(), movePaddingToFillOrGenericOp(), padThroughLoopIterArg(), reifyOrComputeDynamicSizes(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), replaceWithConstant(), mlir::linalg::rewriteInIm2Col(), transposeToShuffle16x16(), and transposeToShuffle1D().
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(), buildUnresolvedTargetMaterialization(), destructureSlot(), mlir::bufferization::BufferPlacementTransformationBase::findCommonDominator(), mlir::linalg::fuseProducerOfTensor(), 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.
Referenced by mlir::LocalAliasAnalysis::aliasImpl(), mlir::getEnclosingRepetitiveRegion(), mlir::bufferization::AnalysisState::getEnclosingRepetitiveRegion(), handleByValArgumentInit(), hasAllocationScope(), insertCopyLoops(), and mlir::transform::TransformState::mapBlockArguments().
|
inline |
Return the type of this value.
Definition at line 122 of file Value.h.
Referenced by mlir::ArithBuilder::add(), addAtomicRMW(), addBodyWithPayloadOp(), mlir::affine::MemRefDependenceGraph::addEdge(), addExecuteResults(), addFilterLoopBasedConstraints(), addSliceBasedConstraints(), mlir::bufferization::allocateTensorForShapedValue(), mlir::allOperandsHaveSameCoopMatrixType(), appendX1Dim(), applyPad(), mlir::detail::ConversionPatternRewriterImpl::applyRewrites(), applyToIntegerAttrs(), 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(), buildSubAndExpOp(), mlir::tosa::buildUnaryOpQuantizationAttr(), castAllocFuncResult(), castBoolToIntN(), castIntNToBool(), mlir::bufferization::castOrReallocMemRefValue(), castToCompatibleMemRefType(), castToF32(), castToSourceType(), ceilDivPositive(), checkLayout(), mlir::detail::TypedValue< Ty >::classof(), mlir::linalg::collapseGenericOpIterationDims(), 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(), mlir::linalg::createFoldedDimOp(), createFullPartialVectorTransferRead(), createGroupReduceOp(), createGroupReduceOpImpl(), createMemcpy(), mlir::vector::createOrFoldDimOp(), mlir::linalg::createOrFoldDimOp(), mlir::sparse_tensor::createOrFoldSliceOffsetOp(), mlir::sparse_tensor::createOrFoldSliceStrideOp(), createPartitionFunc(), createQuickSort(), createQuickSortFunc(), createScanLoop(), createShiftDownFunc(), createSortStableFunc(), createSubViewIntersection(), createTruncatedFPValue(), declareReduction(), mlir::bufferization::detail::defaultGetBufferType(), defaultIsSmallAlloc(), dispatchMappedValues(), doubleBuffer(), mlir::bufferization::dropEquivalentBufferResults(), dropTrailingX1Dim(), emitElementwiseComputation(), ensureToMemrefOpIsValid(), mlir::tosa::EqualizeRanks(), expandRank(), expandValue(), extendMaskRank(), extendVectorRank(), extractLastDimSlice(), extractOne(), findHoistableMatchingExtractSlice(), findHoistableMatchingTransferRead(), mlir::bufferization::AnalysisState::findValueInReverseUseDefChain(), foldExtractFromBroadcast(), foreachIndividualVectorElement(), forwardStoreToLoad(), mlir::linalg::fuseProducerOfTensor(), mlir::sparse_tensor::genCast(), generatePointWiseCopy(), genIf(), mlir::sparse_tensor::genIndexLoad(), mlir::sparse_tensor::genIsNonzero(), genSliceOffset(), genSliceStride(), mlir::sparse_tensor::genToMemref(), mlir::bufferization::getBuffer(), mlir::getBufferizationOptionsForSparsification(), mlir::bufferization::getBufferType(), getConstantUint32(), getContext(), getConvOutputDim(), 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(), getReshapeOutputShapeFromInputShape(), getScalarOrElementWidth(), mlir::ValueShapeRange::getShape(), getSlice(), 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(), insertCopies(), insertCopyLoops(), insertLastDimSlice(), insertOne(), isAccessIndexInvariant(), isDefinedByCallTo(), mlir::OperationEquivalence::isEquivalentTo(), isGpuAsyncTokenType(), isMemref(), mlir::OperationEquivalence::isRegionEquivalentTo(), isSparseTensor(), mlir::affine::isValidDim(), mlir::affine::isValidSymbol(), mlir::bufferization::AnalysisState::isValueRead(), legalizeUnresolvedMaterialization(), linalgIntBroadcastExtSIAdd(), mlir::sparse_tensor::loadAll(), mlir::linalg::makeMemRefCopyOp(), mlir::linalg::makeTransposeOp(), mlir::ValueTypeIterator< ValueIteratorT >::mapElement(), mlir::OperandElementTypeIterator::mapElement(), mlir::ResultElementTypeIterator::mapElement(), matchAndReplaceDepthwiseConv(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), ConvertAccessChain::matchAndRewrite(), mlir::affine::materializeComputedBound(), mlir::linalg::materializeTiledShape(), 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(), mlir::spirv::printGroupNonUniformArithmeticOp(), mlir::ValueBoundsConstraintSet::processWorklist(), mlir::scf::promote(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), rankReducingSubviewDroppingUnitDims(), reduce(), reifyOrComputeDynamicSizes(), 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(), mlir::linalg::rewriteInIm2Col(), mlir::ArithBuilder::sgt(), shiftValue(), mlir::ArithBuilder::slt(), mlir::vector::splitFullAndPartialTransfer(), splitIntegerStore(), splitVectorStore(), mlir::sparse_tensor::storeAll(), mlir::ArithBuilder::sub(), transposeOneLinalgOperandAndReplace(), transposeToShuffle16x16(), truncToI32(), unpackOperandVector(), vectorShape(), visitUpward(), wmmaPushInputOperand(), wmmaPushOutputOperand(), and wrapExternalFunction().
|
inline |
Definition at line 222 of file Value.h.
References user_begin(), and user_end().
Referenced by computeNecessaryMaterializations(), mlir::memref::findDealloc(), findHoistableMatchingExtractSlice(), findHoistableMatchingTransferRead(), findLiveUserOfReplaced(), mlir::LivenessBlockInfo::getEndOperation(), mlir::getForwardSlice(), hasNonAffineUsersOnThePath(), isEscapingMemref(), mlir::matchReduction(), maybeCaptured(), noAliasingUseInLoop(), mlir::affine::normalizeMemRef(), mlir::dataflow::AbstractSparseLattice::onUpdate(), replaceForAllWithNewSignature(), and tileAndFuseFirstExtractUseThroughContainingOpBlockArgument().
|
inline |
Returns a range of all uses, which is useful for iterating over all uses.
Definition at line 206 of file Value.h.
References use_begin(), and use_end().
Referenced by checkDoubleConsume(), computeDestructuringInfo(), dropRefIfNoUses(), getSubViewUseIfUnique(), isTensorChunkAccessedByUnknownOp(), mlir::bufferization::AnalysisState::isValueRead(), mlir::bufferization::OneShotAnalysisState::isValueWritten(), mlir::linalg::LinalgCopyVTRForwardingPattern::matchAndRewrite(), processValue(), mlir::replaceAllUsesInRegionWith(), mlir::RewriterBase::replaceUsesWithIf(), and mlir::Liveness::resolveLiveness().
|
inline |
Returns true if this value has exactly one use.
Definition at line 209 of file Value.h.
Referenced by isResultValueDead(), and mlir::matchReduction().
|
inline |
Definition at line 98 of file Value.h.
Referenced by mlir::bufferization::ValueComparator::operator()().
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().
|
inlineexplicit |
|
inline |
|
inline |
void Value::print | ( | raw_ostream & | os | ) |
Definition at line 3779 of file AsmPrinter.cpp.
Referenced by mlir::operator<<(), and mlir::Diagnostic::operator<<().
void Value::print | ( | raw_ostream & | os, |
AsmState & | state | ||
) |
Definition at line 3793 of file AsmPrinter.cpp.
void Value::print | ( | raw_ostream & | os, |
const OpPrintingFlags & | flags | ||
) |
Definition at line 3780 of file AsmPrinter.cpp.
void Value::printAsOperand | ( | raw_ostream & | os, |
AsmState & | state | ||
) |
Print this value as if it were an operand.
Definition at line 3813 of file AsmPrinter.cpp.
void Value::printAsOperand | ( | raw_ostream & | os, |
const OpPrintingFlags & | flags | ||
) |
Definition at line 3838 of file AsmPrinter.cpp.
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 normalizeLoop().
|
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 166 of file Value.h.
Referenced by mlir::detail::ConversionPatternRewriterImpl::applyRewrites(), forwardStoreToLoad(), loadCSE(), 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 82 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 133 of file Value.h.
Referenced by mlir::detail::TypedValue< Ty >::setType().
void Value::shuffleUseList | ( | ArrayRef< unsigned > | indices | ) |
|
inline |
Definition at line 202 of file Value.h.
Referenced by getUses(), mlirValueGetFirstUse(), and user_begin().
|
inline |
Returns true if this value has no uses.
Definition at line 212 of file Value.h.
Referenced by computeDestructuringInfo(), destructureSlot(), generateUnrolledLoop(), isResultValueDead(), mlir::affine::loopUnrollJamByFactor(), mlirValueGetFirstUse(), mlir::tryToPromoteMemorySlots(), and mlir::ResultRange::use_empty().
|
inline |
Definition at line 203 of file Value.h.
Referenced by getUses(), and user_end().
|
inline |
Definition at line 220 of file Value.h.
References use_begin().
Referenced by getUsers(), and isResultValueDead().
|
inline |
Definition at line 221 of file Value.h.
References use_end().
Referenced by computeNecessaryMaterializations(), findLiveUserOfReplaced(), and getUsers().
|
friend |
|
protected |
A pointer to the internal implementation of the value.
Definition at line 247 of file Value.h.
Referenced by getAsOpaquePointer(), getImpl(), operator bool(), and operator==().