Go to the documentation of this file.
16 #ifndef LLVM_ADT_POSTORDERITERATOR_H
17 #define LLVM_ADT_POSTORDERITERATOR_H
58 template<
class SetType,
bool External>
64 template <
typename NodeRef>
66 return Visited.insert(To).second;
74 template<
class SetType>
86 return Visited.insert(To).second;
93 template <
class GraphT,
95 bool ExtStorage =
false,
class GT = GraphTraits<GraphT>>
106 using ChildItTy =
typename GT::ChildIteratorType;
114 VisitStack.push_back(std::make_pair(
BB, GT::child_begin(
BB)));
123 VisitStack.push_back(std::make_pair(
BB, GT::child_begin(
BB)));
128 po_iterator(SetType &
S)
129 : po_iterator_storage<SetType, ExtStorage>(
S) {
132 void traverseChild() {
133 while (VisitStack.back().second != GT::child_end(VisitStack.back().first)) {
134 NodeRef
BB = *VisitStack.back().second++;
135 if (this->
insertEdge(Optional<NodeRef>(VisitStack.back().first),
BB)) {
137 VisitStack.push_back(std::make_pair(
BB, GT::child_begin(
BB)));
155 return VisitStack ==
x.VisitStack;
159 const NodeRef &
operator*()
const {
return VisitStack.back().first; }
169 VisitStack.pop_back();
170 if (!VisitStack.empty())
200 template<
class T,
class SetType>
205 template<
class T,
class SetType>
210 template <
class T,
class SetType>
217 bool External =
false>
247 template <
class T,
class SetType>
252 template <
class T,
class SetType>
257 template <
class T,
class SetType>
258 iterator_range<ipo_ext_iterator<T, SetType>>
290 template<
class GraphT,
class GT = GraphTraits<GraphT>>
294 std::vector<NodeRef> Blocks;
296 void Initialize(
const GraphT &
G) {
315 #endif // LLVM_ADT_POSTORDERITERATOR_H
iterator_range< po_ext_iterator< T, SetType > > post_order_ext(const T &G, SetType &S)
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
ipo_ext_iterator< T, SetType > ipo_ext_begin(const T &G, SetType &S)
iterator_range< ipo_iterator< T > > inverse_post_order(const T &G)
po_iterator< T > po_end(const T &G)
bool operator!=(const po_iterator &x) const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
void finishPostorder(NodeRef BB)
void finishPostorder(NodeRef BB)
ipo_iterator< T > ipo_begin(const T &G)
NodeRef operator->() const
po_ext_iterator< T, SetType > po_ext_end(T G, SetType &S)
po_iterator_storage(const po_iterator_storage &S)
alloca< 16 x float >, align 16 %tmp2=alloca< 16 x float >, align 16 store< 16 x float > %A,< 16 x float > *%tmp %s=bitcast< 16 x float > *%tmp to i8 *%s2=bitcast< 16 x float > *%tmp2 to i8 *call void @llvm.memcpy.i64(i8 *%s, i8 *%s2, i64 64, i32 16) %R=load< 16 x float > *%tmp2 ret< 16 x float > %R } declare void @llvm.memcpy.i64(i8 *nocapture, i8 *nocapture, i64, i32) nounwind which compiles to:_foo:subl $140, %esp movaps %xmm3, 112(%esp) movaps %xmm2, 96(%esp) movaps %xmm1, 80(%esp) movaps %xmm0, 64(%esp) movl 60(%esp), %eax movl %eax, 124(%esp) movl 56(%esp), %eax movl %eax, 120(%esp) movl 52(%esp), %eax< many many more 32-bit copies > movaps(%esp), %xmm0 movaps 16(%esp), %xmm1 movaps 32(%esp), %xmm2 movaps 48(%esp), %xmm3 addl $140, %esp ret On Nehalem, it may even be cheaper to just use movups when unaligned than to fall back to lower-granularity chunks. Implement processor-specific optimizations for parity with GCC on these processors. GCC does two optimizations:1. ix86_pad_returns inserts a noop before ret instructions if immediately preceded by a conditional branch or is the target of a jump. 2. ix86_avoid_jump_misspredicts inserts noops in cases where a 16-byte block of code contains more than 3 branches. The first one is done for all AMDs, Core2, and "Generic" The second one is done for:Atom, Pentium Pro, all AMDs, Pentium 4, Nocona, Core 2, and "Generic" Testcase:int x(int a) { return(a &0xf0)> >4 tmp
Default po_iterator_storage implementation with an internal set object.
po_iterator< T > po_begin(const T &G)
typename std::vector< NodeRef >::reverse_iterator rpo_iterator
static po_iterator end(const GraphT &G)
ipo_iterator(const po_iterator< Inverse< T >, SetType, External > &V)
ReversePostOrderTraversal(const GraphT &G)
po_ext_iterator< T, SetType > po_ext_begin(T G, SetType &S)
std::pair< NodeId, LaneBitmask > NodeRef
po_iterator operator++(int)
std::forward_iterator_tag iterator_category
typename std::vector< NodeRef >::const_reverse_iterator const_rpo_iterator
po_iterator & operator++()
po_ext_iterator(const po_iterator< T, SetType, true > &V)
bool operator==(const po_iterator &x) const
iterator_range< ipo_ext_iterator< T, SetType > > inverse_post_order_ext(const T &G, SetType &S)
const_rpo_iterator begin() const
typename GraphTraits< Inverse< T > > ::NodeRef value_type
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
ipo_ext_iterator(const po_iterator< Inverse< T >, SetType, true > &V)
ipo_ext_iterator(const ipo_iterator< T, SetType, true > &V)
static po_iterator begin(const GraphT &G)
iterator_range< po_iterator< T > > post_order(const T &G)
ipo_ext_iterator< T, SetType > ipo_ext_end(const T &G, SetType &S)
bool insertEdge(Optional< NodeRef > From, NodeRef To)
std::ptrdiff_t difference_type
const NodeRef & operator*() const
A range adaptor for a pair of iterators.
const_rpo_iterator end() const
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
BlockVerifier::State From
ipo_iterator< T > ipo_end(const T &G)
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 copy
static po_iterator begin(const GraphT &G, SetType &S)
static po_iterator end(const GraphT &G, SetType &S)
po_iterator_storage(SetType &VSet)
bool insertEdge(Optional< NodeRef > From, NodeRef To)