LLVM 20.0.0git
|
This class implements a map that also provides access to all stored values in a deterministic order. More...
#include "llvm/ADT/MapVector.h"
Inherited by llvm::SmallMapVector< llvm::Use *, llvm::Value *, 32 >, llvm::SmallMapVector< llvm::Value *, llvm::PointerIntPair< llvm::Value *, 1, bool >, 32 >, llvm::SmallMapVector< llvm::Value *, llvm::WeakTrackingVH, 16 >, llvm::SmallMapVector< llvm::Value *, llvm::Value *, 4 >, llvm::SmallMapVector< const llvm::RecurrenceDescriptor *, llvm::PHINode *, 4 >, llvm::SmallMapVector< unsigned, unsigned, 4 >, and llvm::SmallMapVector< const llvm::Value *, std::pair< llvm::Value *, llvm::Value * >, 4 >.
Public Types | |
using | key_type = KeyT |
using | value_type = typename VectorType::value_type |
using | size_type = typename VectorType::size_type |
using | iterator = typename VectorType::iterator |
using | const_iterator = typename VectorType::const_iterator |
using | reverse_iterator = typename VectorType::reverse_iterator |
using | const_reverse_iterator = typename VectorType::const_reverse_iterator |
Public Member Functions | |
VectorType | takeVector () |
Clear the MapVector and return the underlying vector. | |
size_type | size () const |
void | reserve (size_type NumEntries) |
Grow the MapVector so that it can contain at least NumEntries items before resizing again. | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
bool | empty () const |
std::pair< KeyT, ValueT > & | front () |
const std::pair< KeyT, ValueT > & | front () const |
std::pair< KeyT, ValueT > & | back () |
const std::pair< KeyT, ValueT > & | back () const |
void | clear () |
void | swap (MapVector &RHS) |
ValueT & | operator[] (const KeyT &Key) |
ValueT | lookup (const KeyT &Key) const |
template<typename... Ts> | |
std::pair< iterator, bool > | try_emplace (const KeyT &Key, Ts &&...Args) |
template<typename... Ts> | |
std::pair< iterator, bool > | try_emplace (KeyT &&Key, Ts &&...Args) |
std::pair< iterator, bool > | insert (const std::pair< KeyT, ValueT > &KV) |
std::pair< iterator, bool > | insert (std::pair< KeyT, ValueT > &&KV) |
template<typename V > | |
std::pair< iterator, bool > | insert_or_assign (const KeyT &Key, V &&Val) |
template<typename V > | |
std::pair< iterator, bool > | insert_or_assign (KeyT &&Key, V &&Val) |
bool | contains (const KeyT &Key) const |
size_type | count (const KeyT &Key) const |
iterator | find (const KeyT &Key) |
const_iterator | find (const KeyT &Key) const |
void | pop_back () |
Remove the last element from the vector. | |
VectorType::iterator | erase (typename VectorType::iterator Iterator) |
Remove the element given by Iterator. | |
size_type | erase (const KeyT &Key) |
Remove all elements with the key value Key. | |
template<class Predicate > | |
void | remove_if (Predicate Pred) |
Remove the elements that match the predicate. | |
template<class Function > | |
void | remove_if (Function Pred) |
This class implements a map that also provides access to all stored values in a deterministic order.
The values are kept in a SmallVector<*, 0> and the mapping is done with DenseMap from Keys to indexes in that vector.
Definition at line 36 of file MapVector.h.
using llvm::MapVector< KeyT, ValueT, MapType, VectorType >::const_iterator = typename VectorType::const_iterator |
Definition at line 50 of file MapVector.h.
using llvm::MapVector< KeyT, ValueT, MapType, VectorType >::const_reverse_iterator = typename VectorType::const_reverse_iterator |
Definition at line 52 of file MapVector.h.
using llvm::MapVector< KeyT, ValueT, MapType, VectorType >::iterator = typename VectorType::iterator |
Definition at line 49 of file MapVector.h.
using llvm::MapVector< KeyT, ValueT, MapType, VectorType >::key_type = KeyT |
Definition at line 45 of file MapVector.h.
using llvm::MapVector< KeyT, ValueT, MapType, VectorType >::reverse_iterator = typename VectorType::reverse_iterator |
Definition at line 51 of file MapVector.h.
using llvm::MapVector< KeyT, ValueT, MapType, VectorType >::size_type = typename VectorType::size_type |
Definition at line 47 of file MapVector.h.
using llvm::MapVector< KeyT, ValueT, MapType, VectorType >::value_type = typename VectorType::value_type |
Definition at line 46 of file MapVector.h.
|
inline |
Definition at line 85 of file MapVector.h.
References llvm::Vector.
|
inline |
Definition at line 86 of file MapVector.h.
References llvm::Vector.
|
inline |
Definition at line 69 of file MapVector.h.
References llvm::Vector.
Referenced by llvm::DbgValueHistoryMap::begin(), llvm::DbgLabelInstrMap::begin(), llvm::ScheduleDAGInstrs::insertBarrierChain(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::try_emplace(), and llvm::writeIndex().
|
inline |
Definition at line 70 of file MapVector.h.
References llvm::Vector.
|
inline |
Definition at line 88 of file MapVector.h.
References llvm::Vector.
Referenced by ARM64ProcessEpilogs(), ARMEmitUnwindInfo(), llvm::AccelTable< DataT >::clear(), llvm::DbgValueHistoryMap::clear(), llvm::DbgLabelInstrMap::clear(), llvm::ScheduleDAGInstrs::Value2SUsMap::clear(), interpretValues(), llvm::StackMaps::reset(), writeMemProfFrameArray(), writeMemProfFrames(), and writeMemProfRecords().
|
inline |
Definition at line 163 of file MapVector.h.
Referenced by ARM64ProcessEpilogs(), ARMEmitUnwindInfo(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::count(), llvm::SelectionDAGBuilder::shouldKeepJumpConditionsTogether(), and llvm::VPlanTransforms::truncateToMinimalBitwidths().
|
inline |
Definition at line 165 of file MapVector.h.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::contains().
Referenced by llvm::SIMachineFunctionInfo::allocateWWMSpill(), llvm::SPIRVGeneralDuplicatesTracker::buildDepsGraph(), llvm::checkDebugInfoMetadata(), llvm::collectDebugInfoMetadata(), doRematerializations(), findBasePointer(), llvm::LoopVectorizationLegality::isInductionPhi(), llvm::LoopVectorizationLegality::isReductionVariable(), llvm::SCCPInstVisitor::resetLatticeValueFor(), and llvm::slpvectorizer::BoUpSLP::vectorizeTree().
|
inline |
Definition at line 79 of file MapVector.h.
References llvm::Vector.
Referenced by llvm::InterleavedAccessInfo::analyzeInterleaving(), llvm::DbgValueHistoryMap::empty(), llvm::DbgLabelInstrMap::empty(), foldCondBranchOnValueKnownInPredecessorImpl(), getSalvageOpsForGEP(), llvm::LoopVectorizationCostModel::getSmallestAndWidestTypes(), interpretNextInstr(), llvm::LoopVectorizationCostModel::selectInterleaveCount(), and llvm::writeIndex().
|
inline |
Definition at line 71 of file MapVector.h.
References llvm::Vector.
Referenced by llvm::ScheduleDAGInstrs::addChainDependencies(), llvm::MCLineSection::addEndEntry(), llvm::slpvectorizer::BoUpSLP::buildExternalUses(), checkFunctions(), checkInstructions(), checkVars(), computeBaseDerivedRelocateMap(), llvm::DbgValueHistoryMap::end(), llvm::DbgLabelInstrMap::end(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::erase(), llvm::SPIRVDuplicatesTrackerBase< KeyTy >::find(), findBasePointer(), llvm::ScheduleDAGInstrs::insertBarrierChain(), insertDbgVariableRecordsForPHIs(), llvm::insertDebugValuesForPHIs(), llvm::lto::thinBackend(), and llvm::MapVector< KeyT, ValueT, MapType, VectorType >::try_emplace().
|
inline |
Definition at line 72 of file MapVector.h.
References llvm::Vector.
|
inline |
Remove all elements with the key value Key.
Returns the number of elements removed.
Definition at line 212 of file MapVector.h.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::erase(), and llvm::MapVector< KeyT, ValueT, MapType, VectorType >::find().
|
inline |
Remove the element given by Iterator.
Returns an iterator to the element following the one which was removed, which may be end().
Definition at line 193 of file MapVector.h.
References assert(), I, and llvm::Vector.
Referenced by collectCallSiteParameters(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::erase(), interpretValues(), and llvm::SIMachineFunctionInfo::shiftSpillPhysVGPRsToLowestRange().
|
inline |
Definition at line 167 of file MapVector.h.
References llvm::Vector.
Referenced by llvm::ScheduleDAGInstrs::addChainDependencies(), llvm::MCLineSection::addEndEntry(), llvm::InterleavedAccessInfo::analyzeInterleaving(), llvm::slpvectorizer::BoUpSLP::buildExternalUses(), checkFunctions(), checkInstructions(), checkVars(), llvm::LoopVectorizationCostModel::collectElementTypesForWidening(), computeBaseDerivedRelocateMap(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::erase(), llvm::SPIRVDuplicatesTrackerBase< KeyTy >::find(), findBasePointer(), llvm::LoopVectorizationLegality::getIntOrFpInductionDescriptor(), llvm::LoopVectorizationLegality::getPointerInductionDescriptor(), llvm::LoopVectorizationCostModel::getReductionPatternCost(), insertDbgVariableRecordsForPHIs(), llvm::insertDebugValuesForPHIs(), llvm::lto::thinBackend(), and llvm::VPRecipeBuilder::tryToCreateWidenRecipe().
|
inline |
Definition at line 173 of file MapVector.h.
References llvm::Vector.
|
inline |
Definition at line 83 of file MapVector.h.
References llvm::Vector.
Referenced by GEPToVectorIndex(), and parseJumpTable().
|
inline |
Definition at line 84 of file MapVector.h.
References llvm::Vector.
|
inline |
Definition at line 141 of file MapVector.h.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::try_emplace().
Referenced by addAllTypesFromDWP(), addAllTypesFromTypesSection(), addToFwdRegWorklist(), llvm::SCCPInstVisitor::addTrackedFunction(), llvm::SIMachineFunctionInfo::allocateWWMSpill(), llvm::checkDebugInfoMetadata(), collectCallSiteParameters(), llvm::collectDebugInfoMetadata(), llvm::GEPOperator::collectOffset(), llvm::LoopVectorizationCostModel::collectValuesToIgnore(), computeBaseDerivedRelocateMap(), llvm::VPRecipeBuilder::createSwitchEdgeMasks(), findBasePointer(), llvm::InstCombinerImpl::foldAllocaCmp(), foldCondBranchOnValueKnownInPredecessorImpl(), llvm::object::ELFFile< ELFT >::getSectionAndRelocations(), insertDbgVariableRecordsForPHIs(), llvm::insertDebugValuesForPHIs(), runImpl(), llvm::SIMachineFunctionInfo::shiftSpillPhysVGPRsToLowestRange(), and llvm::write().
|
inline |
Definition at line 144 of file MapVector.h.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::try_emplace().
|
inline |
Definition at line 149 of file MapVector.h.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::try_emplace().
|
inline |
Definition at line 156 of file MapVector.h.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::try_emplace().
|
inline |
Definition at line 110 of file MapVector.h.
References llvm::Vector.
Referenced by ARM64ProcessEpilogs(), ARMEmitUnwindInfo(), llvm::SPIRVGeneralDuplicatesTracker::buildDepsGraph(), and llvm::VPlanTransforms::truncateToMinimalBitwidths().
|
inline |
Definition at line 98 of file MapVector.h.
References I, and llvm::Vector.
Referenced by llvm::ScheduleDAGInstrs::Value2SUsMap::insert().
|
inline |
Remove the last element from the vector.
Definition at line 180 of file MapVector.h.
References llvm::Vector.
|
inline |
Definition at line 74 of file MapVector.h.
References llvm::Vector.
Referenced by llvm::InterleavedAccessInfo::analyzeInterleaving().
|
inline |
Definition at line 75 of file MapVector.h.
References llvm::Vector.
void llvm::MapVector< KeyT, ValueT, MapType, VectorType >::remove_if | ( | Function | Pred | ) |
Definition at line 229 of file MapVector.h.
References E, I, and llvm::Vector.
void llvm::MapVector< KeyT, ValueT, MapType, VectorType >::remove_if | ( | Predicate | Pred | ) |
Remove the elements that match the predicate.
Erase all elements that match Pred
in a single pass. Takes linear time.
Referenced by llvm::ScheduleDAGInstrs::insertBarrierChain().
|
inline |
Definition at line 76 of file MapVector.h.
References llvm::Vector.
Referenced by llvm::InterleavedAccessInfo::analyzeInterleaving().
|
inline |
Definition at line 77 of file MapVector.h.
References llvm::Vector.
|
inline |
Grow the MapVector so that it can contain at least NumEntries
items before resizing again.
Definition at line 64 of file MapVector.h.
References llvm::Vector.
|
inline |
Definition at line 60 of file MapVector.h.
References llvm::Vector.
Referenced by llvm::OpenMPIRBuilder::applySimd(), llvm::LoopVectorizationCostModel::calculateRegisterUsage(), clusterSortPtrAccesses(), llvm::collectDebugInfoMetadata(), collectOffsets(), llvm::AccelTableBase::computeBucketCount(), findBasePointer(), GEPToVectorIndex(), llvm::AccelTableBase::getUniqueNameCount(), parseJumpTable(), llvm::AArch64TTIImpl::preferPredicateOverEpilogue(), llvm::VPlanTransforms::truncateToMinimalBitwidths(), llvm::writeIndex(), and writeMemProfFrameArray().
|
inline |
Definition at line 93 of file MapVector.h.
References RHS, std::swap(), and llvm::Vector.
|
inline |
Clear the MapVector and return the underlying vector.
Definition at line 55 of file MapVector.h.
References llvm::Vector.
Referenced by computeFunctionSummary().
|
inline |
Definition at line 118 of file MapVector.h.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::begin(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end(), and llvm::Vector.
Referenced by collectInstructionDeps(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::insert(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::insert_or_assign(), and llvm::SelectionDAGBuilder::shouldKeepJumpConditionsTogether().
|
inline |
Definition at line 129 of file MapVector.h.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::begin(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end(), and llvm::Vector.