MLIR
20.0.0git
|
This is a utility class for mapping one set of IR entities to another. More...
#include "mlir/IR/IRMapping.h"
Public Member Functions | |
void | map (Value from, Value to) |
Inserts a new mapping for 'from' to 'to'. More... | |
void | map (Block *from, Block *to) |
void | map (Operation *from, Operation *to) |
template<typename S , typename T , std::enable_if_t<!std::is_assignable_v< Value, S > &&!std::is_assignable_v< Block *, S > &&!std::is_assignable_v< Operation *, S >> * = nullptr> | |
void | map (S &&from, T &&to) |
template<typename T > | |
void | erase (T from) |
Erases a mapping for 'from'. More... | |
template<typename T > | |
bool | contains (T from) const |
Checks to see if a mapping for 'from' exists. More... | |
template<typename T > | |
auto | lookupOrNull (T from) const |
Lookup a mapped value within the map. More... | |
template<typename T > | |
auto | lookupOrDefault (T from) const |
Lookup a mapped value within the map. More... | |
template<typename T > | |
auto | lookup (T from) const |
Lookup a mapped value within the map. More... | |
void | clear () |
Clears all mappings held by the mapper. More... | |
const DenseMap< Value, Value > & | getValueMap () const |
Return the held value mapping. More... | |
const DenseMap< Block *, Block * > & | getBlockMap () const |
Return the held block mapping. More... | |
const DenseMap< Operation *, Operation * > & | getOperationMap () const |
Return the held operation mapping. More... | |
This is a utility class for mapping one set of IR entities to another.
New mappings can be inserted via 'map'. Existing mappings can be found via the 'lookup*' functions. There are three variants that differ only in return value when an existing is not found for the provided key: SSA values, blocks, and operations. 'lookupOrNull' returns nullptr where as 'lookupOrDefault' will return the lookup key.
Definition at line 26 of file IRMapping.h.
|
inline |
Clears all mappings held by the mapper.
Definition at line 79 of file IRMapping.h.
Referenced by addExecuteResults(), and hoistAffineIfOp().
|
inline |
Checks to see if a mapping for 'from' exists.
Definition at line 51 of file IRMapping.h.
Referenced by mlir::Region::cloneInto(), and mlir::mesh::spmdizeOperation().
|
inline |
Erases a mapping for 'from'.
Definition at line 45 of file IRMapping.h.
Return the held block mapping.
Definition at line 85 of file IRMapping.h.
Return the held operation mapping.
Definition at line 88 of file IRMapping.h.
Referenced by mlir::applyAnalysisConversion().
Return the held value mapping.
Definition at line 82 of file IRMapping.h.
|
inline |
Lookup a mapped value within the map.
This asserts the provided value exists within the map.
Definition at line 72 of file IRMapping.h.
References lookupOrNull().
Referenced by mlir::applyAnalysisConversion(), buildPackingLoopNestImpl(), mlir::Region::cloneInto(), mlir::OpBuilder::cloneRegionBefore(), mlir::linalg::createAllReduceForResultWithoutPartialSharding(), mlir::linalg::createDestinationPassingStyleInitOperands(), generateUnrolledLoop(), handleArgumentImpl(), mlir::ReductionNode::initialize(), outlineKernelFuncImpl(), reduceIfNeeded(), remainsLegalAfterInline(), replaceByPackingResult(), rewriteOneForallCommonImpl(), mlir::linalg::spmdizeLinalgOpWithShardedReduction(), and mlir::mesh::spmdizeOperation().
|
inline |
Lookup a mapped value within the map.
If a mapping for the provided value does not exist then return the provided value.
Definition at line 65 of file IRMapping.h.
Referenced by buildPackingLoopNestImpl(), mlir::Operation::clone(), generateFusedElementwiseOpRegion(), inlinePayload(), inlineRegionAndEmitStore(), and processParallelLoop().
|
inline |
Lookup a mapped value within the map.
If a mapping for the provided value does not exist then return nullptr.
Definition at line 58 of file IRMapping.h.
Referenced by mlir::affine::fuseLoops(), lookup(), and remapInlinedOperands().
Definition at line 31 of file IRMapping.h.
Definition at line 32 of file IRMapping.h.
|
inline |
Definition at line 38 of file IRMapping.h.
References map().
Inserts a new mapping for 'from' to 'to'.
If there is an existing mapping, it is overwritten.
Definition at line 30 of file IRMapping.h.
Referenced by mlir::sparse_tensor::Merger::buildExp(), buildPackingLoopNestImpl(), mlir::Operation::clone(), mlir::Region::cloneInto(), mlir::linalg::createAllReduceForResultWithoutPartialSharding(), createFullPartialVectorTransferWrite(), createFullTiles(), createParallelComputeFunction(), mlir::query::extractFunction(), fuseIfLegal(), mlir::fuseIndependentSiblingForallLoops(), mlir::fuseIndependentSiblingForLoops(), genCoIterateBranchNest(), generateFusedElementwiseOpRegion(), generateShiftedLoop(), generateUnrolledLoop(), handleArgumentImpl(), injectGpuIndexOperations(), mlir::inlineCall(), inlinePayload(), inlineRegionAndEmitStore(), mlir::makeRegionIsolatedFromAbove(), map(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), outlineExecuteOp(), outlineKernelFuncImpl(), mlir::outlineSingleBlockRegion(), processParallelLoop(), rewriteOneForallCommonImpl(), specializeForLoopForUnrolling(), specializeParallelLoopForUnrolling(), mlir::vector::splitFullAndPartialTransfer(), mlir::mesh::spmdizeBlock(), mlir::linalg::spmdizeLinalgOpWithShardedReduction(), mlir::mesh::spmdizeOperation(), tileAndFuseFirstExtractUseThroughContainingOpBlockArgument(), and verifyDependencies().