Go to the documentation of this file.
14 #ifndef LLVM_ADT_SMALLSET_H
15 #define LLVM_ADT_SMALLSET_H
27 #include <type_traits>
34 template <
typename T,
unsigned N,
typename C>
37 std::forward_iterator_tag, T> {
39 using SetIterTy =
typename std::set<T, C>::const_iterator;
90 isSmall =
Other.isSmall;
104 isSmall =
Other.isSmall;
113 if (isSmall !=
RHS.isSmall)
135 template <
typename T,
unsigned N,
typename C = std::less<T>>
149 static_assert(
N <= 32,
"N should be small");
158 return Vector.empty() && Set.empty();
162 return isSmall() ?
Vector.size() : Set.size();
169 return vfind(V) ==
Vector.end() ? 0 : 1;
182 std::pair<NoneType, bool>
insert(
const T &V) {
184 return std::make_pair(
None, Set.insert(V).second);
186 VIterator
I = vfind(V);
188 return std::make_pair(
None,
false);
191 return std::make_pair(
None,
true);
196 Set.insert(
Vector.back());
200 return std::make_pair(
None,
true);
203 template <
typename IterT>
228 return {Set.begin()};
240 return vfind(V) !=
Vector.end();
241 return Set.find(V) != Set.end();
245 bool isSmall()
const {
return Set.empty(); }
247 VIterator vfind(
const T &V)
const {
257 template <
typename Po
inteeType,
unsigned N>
268 template <
typename T,
unsigned LN,
unsigned RN,
typename C>
270 if (
LHS.size() !=
RHS.size())
280 template <
typename T,
unsigned LN,
unsigned RN,
typename C>
287 #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
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
SmallSetIterator & operator=(const SmallSetIterator &Other)
const_iterator end() const
typename SuperClass::iterator iterator
LLVM_NODISCARD bool empty() const
SmallSetIterator(const SmallSetIterator &Other)
bool contains(const T &V) const
Check if the SmallSet contains the given element.
Optional< std::vector< StOtherPiece > > Other
void insert(IterT I, IterT E)
bool operator==(const SmallSetIterator &RHS) const