9#ifndef LLVM_ADT_UNIQUEVECTOR_H
10#define LLVM_ADT_UNIQUEVECTOR_H
27 using iterator =
typename VectorType::iterator;
32 std::map<T, unsigned> Map;
42 unsigned &Val = Map[Entry];
48 Val =
static_cast<unsigned>(
Vector.size()) + 1;
57 unsigned idFor(
const T &Entry)
const {
59 typename std::map<T, unsigned>::const_iterator
MI = Map.find(Entry);
62 if (
MI != Map.end())
return MI->second;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
UniqueVector - This class produces a sequential ID number (base 1) for each unique entry that is adde...
typename VectorType::const_iterator const_iterator
unsigned insert(const T &Entry)
insert - Append entry to the vector if it doesn't already exist.
const_iterator begin() const
Return an iterator to the start of the vector.
const T & operator[](unsigned ID) const
operator[] - Returns a reference to the entry with the specified ID.
size_t size() const
size - Returns the number of entries in the vector.
iterator end()
Return an iterator to the end of the vector.
typename VectorType::iterator iterator
bool empty() const
empty - Returns true if the vector is empty.
unsigned idFor(const T &Entry) const
idFor - return the ID for an existing entry.
void reset()
reset - Clears all the entries.
iterator begin()
Return an iterator to the start of the vector.
const_iterator end() const
Return an iterator to the end of the vector.
This is an optimization pass for GlobalISel generic memory operations.