Go to the documentation of this file.
9 #ifndef LLVM_ADT_SIMPLE_ILIST_H
10 #define LLVM_ADT_SIMPLE_ILIST_H
77 template <
typename T,
class...
Options>
81 typename ilist_detail::compute_node_options<T, Options...>::type> {
83 "Unrecognized node option!");
86 using list_base_type =
typename OptionsT::list_base_type;
135 return std::distance(
begin(),
end());
160 list_base_type::insertBefore(*
I.getNodePtr(), *
this->getNodePtr(&
Node));
165 template <
class Iterator>
172 template <
class Cloner,
class Disposer>
186 template <
class Disposer>
197 assert(
I !=
end() &&
"Cannot remove end of list!");
206 list_base_type::removeRange(*
First.getNodePtr(), *Last.getNodePtr());
211 template <
class Disposer>
213 auto Next = std::next(
I);
220 template <
class Disposer>
222 while (
First != Last)
249 list_base_type::transferBefore(*
I.getNodePtr(), *
First.getNodePtr(),
268 template <
class T,
class...
Options>
269 template <
class Compare>
271 if (
this == &
RHS ||
RHS.empty())
276 if (comp(*RI, *LI)) {
280 splice(LI,
RHS, RunStart, RI);
287 splice(
LE,
RHS, RI, RE);
290 template <
class T,
class...
Options>
291 template <
class Compare>
299 while (End !=
end() && ++End !=
end()) {
314 #endif // LLVM_ADT_SIMPLE_ILIST_H
This is an optimization pass for GlobalISel generic memory operations.
LLVM_NODISCARD bool empty() const
Check if the list is empty in constant time.
simple_ilist & operator=(simple_ilist &&X)
void pop_front()
Remove the node at the front; never deletes.
Replace within non kernel function use of LDS with pointer
typename ilist_detail::compute_node_options< MachineInstr, Options... >::type ::pointer pointer
void pop_back()
Remove the node at the back; never deletes.
void clear()
Clear the list; never deletes.
const_reference front() const
const_iterator end(StringRef path)
Get end iterator over path.
void merge(simple_ilist &RHS)
Merge in another list.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
void splice(iterator I, simple_ilist &, iterator First, iterator Last)
Splice in a range of nodes from another list.
static node_type * getNodePtr(pointer N)
const_reverse_iterator rbegin() const
void clearAndDispose(Disposer dispose)
Clear the list and dispose of the nodes.
typename OptionsT::value_type value_type
typename OptionsT::reference reference
typename ilist_detail::compute_node_options< MachineInstr, Options... >::type ::const_pointer const_pointer
const_reverse_iterator rend() const
void sort()
Sort the list.
void removeAndDispose(reference N, Disposer dispose)
Remove a node by reference and dispose of it.
static LoopDeletionResult merge(LoopDeletionResult A, LoopDeletionResult B)
iterator erase(iterator First, iterator Last)
Remove a range of nodes; never deletes.
into llvm powi allowing the code generator to produce balanced multiplication trees First
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
iterator eraseAndDispose(iterator I, Disposer dispose)
Remove a node by iterator and dispose of it.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
void push_front(reference Node)
Insert a node at the front; never copies.
const_iterator end() const
AMD64 Optimization Manual has some nice information about optimizing integer multiplication by a constant How much of it applies to Intel s X86 implementation There are definite trade offs to xmm0 cvttss2siq rdx jb L3 subss xmm0 rax cvttss2siq rdx xorq rdx rax ret instead of xmm1 cvttss2siq rcx movaps xmm2 subss xmm2 cvttss2siq rax rdx xorq rax ucomiss xmm0 cmovb rax ret Seems like the jb branch has high likelihood of being taken It would have saved a few instructions It s not possible to reference and DH registers in an instruction requiring REX prefix divb and mulb both produce results in AH If isel emits a CopyFromReg which gets turned into a movb and that can be allocated a r8b r15b To get around isel emits a CopyFromReg from AX and then right shift it down by and truncate it It s not pretty but it works We need some register allocation magic to make the hack go which would often require a callee saved register Callees usually need to keep this value live for most of their body so it doesn t add a significant burden on them We currently implement this in however this is suboptimal because it means that it would be quite awkward to implement the optimization for callers A better implementation would be to relax the LLVM IR rules for sret arguments to allow a function with an sret argument to have a non void return type
void insert(iterator I, Iterator First, Iterator Last)
Insert a range of nodes; never copies.
ilist_iterator< OptionsT, true, true > const_reverse_iterator
ilist_iterator< OptionsT, false, false > iterator
iterator erase(iterator I)
Remove a node by iterator; never deletes.
simple_ilist(simple_ilist &&X)
typename OptionsT::const_reference const_reference
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void push_back(reference Node)
Insert a node at the back; never copies.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
ilist_iterator< OptionsT, false, true > const_iterator
void swap(simple_ilist &X)
Swap with another list in place using std::swap.
iterator eraseAndDispose(iterator First, iterator Last, Disposer dispose)
Remove a range of nodes and dispose of them.
QP Compare Ordered outs ins xscmpudp No builtin are required Or llvm fcmp order unorder compare DP QP Compare builtin are required DP Compare
std::error_code remove(const Twine &path, bool IgnoreNonExisting=true)
Remove path.
Analysis the ScalarEvolution expression for r is this
reverse_iterator rbegin()
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
void cloneFrom(const simple_ilist &L2, Cloner clone, Disposer dispose)
Clone another list.
constexpr bool empty(const T &RangeOrContainer)
Test whether RangeOrContainer is empty. Similar to C++17 std::empty.
simple_ilist & operator=(const simple_ilist &)=delete
ilist_iterator< OptionsT, true, false > reverse_iterator
const_iterator begin() const
Iterator for intrusive lists based on ilist_node.
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
void sort(IteratorTy Start, IteratorTy End)
void splice(iterator I, simple_ilist &L2)
Splice in another list.
void remove(reference N)
Remove a node by reference; never deletes.
const_reference back() const
Check whether options are valid.
A simple intrusive list implementation.
iterator insert(iterator I, reference Node)
Insert a node by reference; never copies.
void splice(iterator I, simple_ilist &L2, iterator Node)
Splice in a node from another list.
LLVM_NODISCARD size_type size() const
Calculate the size of the list in linear time.