Go to the documentation of this file.
18 #ifndef LLVM_IR_INSTITERATOR_H
19 #define LLVM_IR_INSTITERATOR_H
32 template <
class BB_t,
class BB_i_t,
class BI_t,
class II_t>
class InstIterator {
52 template<
typename A,
typename B,
typename C,
typename D>
54 : BBs(II.BBs),
BB(II.
BB), BI(II.BI) {}
56 template<
typename A,
typename B,
typename C,
typename D>
58 : BBs(II.BBs),
BB(II.
BB), BI(II.BI) {}
61 : BBs(&m.getBasicBlockList()),
BB(BBs->
begin()) {
62 if (
BB != BBs->end()) {
69 : BBs(&m.getBasicBlockList()),
BB(BBs->
end()) {
80 return BB ==
y.BB && (
BB == BBs->end() || BI ==
y.BI);
96 while (
BB == BBs->end() || BI ==
BB->begin()) {
107 inline bool atEnd()
const {
return BB == BBs->end(); }
110 inline void advanceToNextBB() {
113 while (BI ==
BB->end()) {
115 if (BB == BBs->end())
break;
162 #endif // LLVM_IR_INSTITERATOR_H
InstIterator & operator--()
InstIterator< SymbolTableList< BasicBlock >, Function::iterator, BasicBlock::iterator, Instruction > inst_iterator
This is an optimization pass for GlobalISel generic memory operations.
InstListType::iterator iterator
Instruction iterators...
InstIterator & operator++()
iterator_range< const_inst_iterator > const_inst_range
InstIterator< const SymbolTableList< BasicBlock >, Function::const_iterator, BasicBlock::const_iterator, const Instruction > const_inst_iterator
iterator_range< inst_iterator > inst_range
const_iterator end(StringRef path)
Get end iterator over path.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
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
BIty & getInstructionIterator()
InstIterator operator++(int)
bool operator==(const InstIterator &y) const
InstIterator(InstIterator< A, B, C, D > &II)
inst_range instructions(Function *F)
reference operator*() const
InstIterator operator--(int)
std::bidirectional_iterator_tag iterator_category
pointer operator->() const
InstIterator(const InstIterator< A, B, C, D > &II)
inst_iterator inst_end(Function *F)
into llvm powi allowing the code generator to produce balanced multiplication trees the intrinsic needs to be extended to support and second the code generator needs to be enhanced to lower these to multiplication trees Interesting testcase for add shift mul int y
BBIty & getBasicBlockIterator()
A range adaptor for a pair of iterators.
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
inst_iterator inst_begin(Function *F)
bool operator!=(const InstIterator &y) const
BasicBlockListType::const_iterator const_iterator
InstListType::const_iterator const_iterator
BasicBlockListType::iterator iterator