Go to the documentation of this file.
20 #ifndef LLVM_ADT_SETVECTOR_H
21 #define LLVM_ADT_SETVECTOR_H
38 template <
typename T,
typename Vector = std::vector<T>,
39 typename Set = DenseSet<T>>
73 return vector_.empty();
78 return vector_.size();
83 return vector_.begin();
88 return vector_.begin();
103 return vector_.rbegin();
108 return vector_.rbegin();
113 return vector_.rend();
118 return vector_.rend();
123 assert(!
empty() &&
"Cannot call front() on empty SetVector!");
124 return vector_.front();
129 assert(!
empty() &&
"Cannot call back() on empty SetVector!");
130 return vector_.back();
135 assert(
n < vector_.size() &&
"SetVector access out of range!");
142 bool result = set_.insert(
X).second;
144 vector_.push_back(
X);
149 template<
typename It>
151 for (; Start != End; ++Start)
152 if (set_.insert(*Start).second)
153 vector_.push_back(*Start);
160 assert(
I != vector_.end() &&
"Corrupted SetVector instances!");
173 assert(set_.count(V) &&
"Corrupted SetVector instances!");
179 auto NI = vector_.begin();
180 std::advance(NI, std::distance<iterator>(NI,
I));
182 return vector_.erase(NI);
198 template <
typename UnaryPredicate>
202 if (
I == vector_.end())
204 vector_.erase(
I, vector_.end());
210 return set_.find(key) != set_.end();
216 return set_.count(key);
227 assert(!
empty() &&
"Cannot remove an element from an empty SetVector!");
239 return vector_ ==
that.vector_;
243 return vector_ !=
that.vector_;
251 bool Changed =
false;
253 for (
typename STy::const_iterator
SI =
S.begin(), SE =
S.end();
SI != SE;
266 for (
typename STy::const_iterator
SI =
S.begin(), SE =
S.end();
SI != SE;
273 vector_.swap(
RHS.vector_);
281 template <
typename UnaryPredicate>
282 class TestAndEraseFromSet {
287 TestAndEraseFromSet(UnaryPredicate
P,
set_type &set_)
290 template <
typename ArgumentT>
291 bool operator()(
const ArgumentT &
Arg) {
306 template <
typename T,
unsigned N>
308 :
public SetVector<T, SmallVector<T, N>, SmallDenseSet<T, N>> {
313 template<
typename It>
324 template<
typename T,
typename V,
typename S>
331 template<
typename T,
unsigned N>
339 #endif // LLVM_ADT_SETVECTOR_H
void insert(It Start, It End)
Insert a range of elements into the SetVector.
typename vector_type::size_type size_type
This is an optimization pass for GlobalISel generic memory operations.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
size_type size() const
Determine the number of elements in the SetVector.
const_reverse_iterator rend() const
Get a const_reverse_iterator to the beginning of the SetVector.
void pop_back()
Remove the last element of the SetVector.
SetVector(It Start, It End)
Initialize a SetVector with a range of elements.
typename vector_type::const_iterator iterator
typename vector_type::const_iterator const_iterator
ArrayRef< T > getArrayRef() const
SetVector()=default
Construct an empty SetVector.
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
we should consider alternate ways to model stack dependencies Lots of things could be done in WebAssemblyTargetTransformInfo cpp there are numerous optimization related hooks that can be overridden in WebAssemblyTargetLowering Instead of the OptimizeReturned which should consider preserving the returned attribute through to MachineInstrs and extending the MemIntrinsicResults pass to do this optimization on calls too That would also let the WebAssemblyPeephole pass clean up dead defs for such as it does for stores Consider implementing and or getMachineCombinerPatterns Find a clean way to fix the problem which leads to the Shrink Wrapping pass being run after the WebAssembly PEI pass When setting multiple variables to the same we currently get code like const It could be done with a smaller encoding like local tee $pop5 local $pop6 WebAssembly registers are implicitly initialized to zero Explicit zeroing is therefore often redundant and could be optimized away Small indices may use smaller encodings than large indices WebAssemblyRegColoring and or WebAssemblyRegRenumbering should sort registers according to their usage frequency to maximize the usage of smaller encodings Many cases of irreducible control flow could be transformed more optimally than via the transform in WebAssemblyFixIrreducibleControlFlow cpp It may also be worthwhile to do transforms before register particularly when duplicating to allow register coloring to be aware of the duplication WebAssemblyRegStackify could use AliasAnalysis to reorder loads and stores more aggressively WebAssemblyRegStackify is currently a greedy algorithm This means that
bool remove_if(UnaryPredicate P)
Remove items from the set vector based on a predicate function.
bool operator!=(const SetVector &that) const
reverse_iterator rend()
Get a reverse_iterator to the beginning of the SetVector.
It looks like we only need to define PPCfmarto for these because according to these instructions perform RTO on fma s result
const_reverse_iterator rbegin() const
Get a const_reverse_iterator to the end of the SetVector.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
auto remove_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly.
void swap(SetVector< T, Vector, Set > &RHS)
bool remove(const value_type &X)
Remove an item from the set vector.
iterator begin()
Get an iterator to the beginning of the SetVector.
SmallSetVector(It Start, It End)
Initialize a SmallSetVector with a range of elements.
const_iterator end() const
Get a const_iterator to the end of the SetVector.
bool empty() const
Determine if the SetVector is empty or not.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
bool set_union(const STy &S)
Compute This := This u S, return whether 'This' changed.
typename vector_type::const_reverse_iterator reverse_iterator
typename vector_type::const_reverse_iterator const_reverse_iterator
bool contains(const key_type &key) const
Check if the SetVector contains the given key.
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
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
void set_subtract(const STy &S)
Compute This := This - B TODO: We should be able to use set_subtract from SetOperations....
typename SuperClass::const_iterator const_iterator
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
StandardInstrumentations SI(Debug, VerifyEach)
bool insert(const value_type &X)
Insert a new element into the SetVector.
reverse_iterator rbegin()
Get an reverse_iterator to the end of the SetVector.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Instances of this class represent a uniqued identifier for a section in the current translation unit.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
void clear()
Completely clear the SetVector.
const_reference operator[](size_type n) const
Index into the SetVector.
bool operator==(const SetVector &that) const
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
size_type count(const key_type &key) const
Count the number of elements of a given key in the SetVector.
const T & front() const
Return the first element of the SetVector.
iterator end()
Get an iterator to the end of the SetVector.
typename SuperClass::iterator iterator
typename SuperClass::size_type size_type
A SetVector that performs no allocations if smaller than a certain size.
const T & back() const
Return the last element of the SetVector.
Vector takeVector()
Clear the SetVector and return the underlying vector.
The same transformation can work with an even modulo with the addition of a and shrink the compare RHS by the same amount Unless the target supports that transformation probably isn t worthwhile The transformation can also easily be made to work with non zero equality for n
A vector that has set insertion semantics.
iterator erase(iterator I)
Erase a single element from the set vector.
LLVM_NODISCARD T pop_back_val()
const_iterator begin() const
Get a const_iterator to the beginning of the SetVector.