Go to the documentation of this file.
14 #ifndef LLVM_ADT_SMALLSET_H
15 #define LLVM_ADT_SMALLSET_H
26 #include <type_traits>
33 template <
typename T,
unsigned N,
typename C>
36 std::forward_iterator_tag, T> {
38 using SetIterTy =
typename std::set<T, C>::const_iterator;
89 isSmall =
Other.isSmall;
103 isSmall =
Other.isSmall;
112 if (isSmall !=
RHS.isSmall)
134 template <
typename T,
unsigned N,
typename C = std::less<T>>
143 using SIterator =
typename std::set<T, C>::const_iterator;
149 static_assert(
N <= 32,
"N should be small");
157 [[nodiscard]]
bool empty()
const {
return Vector.empty() && Set.empty(); }
160 return isSmall() ?
Vector.size() : Set.size();
167 return vfind(V) ==
Vector.end() ? 0 : 1;
177 std::pair<const_iterator, bool>
insert(
const T &V) {
179 auto [
I, Inserted] = Set.insert(V);
183 VIterator
I = vfind(V);
193 Set.insert(
Vector.back());
199 template <
typename IterT>
224 return {Set.begin()};
236 return vfind(V) !=
Vector.end();
237 return Set.find(V) != Set.end();
241 bool isSmall()
const {
return Set.empty(); }
243 VIterator vfind(
const T &V)
const {
253 template <
typename Po
inteeType,
unsigned N>
264 template <
typename T,
unsigned LN,
unsigned RN,
typename C>
266 if (
LHS.size() !=
RHS.size())
276 template <
typename T,
unsigned LN,
unsigned RN,
typename C>
283 #endif // LLVM_ADT_SMALLSET_H
This is an optimization pass for GlobalISel generic memory operations.
SmallSetIterator(SmallSetIterator &&Other)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
bool operator!=(uint64_t V1, const APInt &V2)
So we should use XX3Form_Rcr to implement intrinsic Convert DP outs ins xscvdpsp No builtin are required Round &Convert QP DP(dword[1] is set to zero) No builtin are required Round to Quad Precision because you need to assign rounding mode in instruction Provide builtin(set f128:$vT,(int_ppc_vsx_xsrqpi f128:$vB))(set f128 yields< n x< ty > >< result > yields< ty >< result > No builtin are required Load Store Vector
SmallSetIterator & operator++()
SmallSetIterator(SetIterTy SetIter)
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
SmallSetIterator(VecIterTy VecIter)
SmallSetIterator & operator=(SmallSetIterator &&Other)
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
typename SuperClass::const_iterator const_iterator
const_iterator begin() const
bool operator==(uint64_t V1, const APInt &V2)
SmallSetIterator - This class implements a const_iterator for SmallSet by delegating to the underlyin...
const T & operator*() const
SmallSetIterator & operator=(const SmallSetIterator &Other)
std::pair< const_iterator, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
const_iterator end() const
std::optional< std::vector< StOtherPiece > > Other
typename SuperClass::iterator iterator
SmallSetIterator< T, N, C > const_iterator
SmallSetIterator(const SmallSetIterator &Other)
bool contains(const T &V) const
Check if the SmallSet contains the given element.
void insert(IterT I, IterT E)
bool operator==(const SmallSetIterator &RHS) const