aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineLoopInfo.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-07-16Rename LoopInfo::Analyze() to LoopInfo::analyze() and turn its parameter ↵Cong Hou1-1/+1
type to const&. The benefit of turning the parameter of LoopInfo::analyze() to const& is that it now can accept a rvalue. http://reviews.llvm.org/D11250 llvm-svn: 242426
2015-03-23Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used.Benjamin Kramer1-0/+1
llvm-svn: 232998
2014-03-02[C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer1-6/+6
Remove the old functions. llvm-svn: 202636
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth1-1/+1
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
2012-09-11Release build: guard dump functions withManman Ren1-1/+1
"#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)" No functional change. Update r163339. llvm-svn: 163653
2012-09-06Release build: guard dump functions with "ifndef NDEBUG"Manman Ren1-0/+2
No functional change. llvm-svn: 163339
2012-06-26Enable the new LoopInfo algorithm by default.Andrew Trick1-9/+1
The primary advantage is that loop optimizations will be applied in a stable order. This helps debugging and unit test creation. It is also a better overall implementation without pathologically bad performance on deep functions. On large functions (llvm-stress --size=200000 | opt -loops) Before: 0.1263s After: 0.0225s On deep functions (after tweaking llvm-stress, thanks Nadav): Before: 0.2281s After: 0.0227s See r158790 for more comments. The loop tree is now consistently generated in forward order, but loop passes are applied in reverse order over the program. If we have a loop optimization that prefers forward order, that can easily be achieved by adding a different type of LoopPassManager. llvm-svn: 159183
2012-06-20A new algorithm for computing LoopInfo. Temporarily disabled.Andrew Trick1-1/+9
-stable-loops enables a new algorithm for generating the Loop forest. It differs from the original algorithm in a few respects: - Not determined by use-list order. - Initially guarantees RPO order of block and subloops. - Linear in the number of CFG edges. - Nonrecursive. I didn't want to change the LoopInfo API yet, so the block lists are still inclusive. This seems strange to me, and it means that building LoopInfo is not strictly linear, but it may not be a problem in practice. At least the block lists start out in RPO order now. In the future we may add an attribute or wrapper analysis that allows other passes to assume RPO order. The primary motivation of this work was not to optimize LoopInfo, but to allow reproducing performance issues by decomposing the compilation stages. I'm often unable to do this with the current LoopInfo, because the loop tree order determines Loop pass order. Serializing the IR tends to invert the order, which reverses the optimization order. This makes it nearly impossible to debug interdependent loop optimizations such as LSR. I also believe this will provide more stable performance results across time. llvm-svn: 158790
2012-06-20Move the implementation of LoopInfo into LoopInfoImpl.h.Andrew Trick1-9/+5
The implementation only needs inclusion from LoopInfo.cpp and MachineLoopInfo.cpp. Clients of the interface should only include the interface. This makes the interface readable and speeds up rebuilds after modifying the implementation. llvm-svn: 158787
2010-10-12Begin adding static dependence information to passes, which will allow us toOwen Anderson1-1/+4
perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
2010-10-07Now with fewer extraneous semicolons!Owen Anderson1-1/+1
llvm-svn: 115996
2010-08-23Now that PassInfo and Pass::ID have been separated, move the rest of the ↵Owen Anderson1-2/+2
passes over to the new registration API. llvm-svn: 111815
2010-08-06Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson1-1/+1
llvm-svn: 110460
2010-08-06Revert r110396 to fix buildbots.Owen Anderson1-1/+1
llvm-svn: 110410
2010-08-05Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson1-1/+1
address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
2010-01-05Restore dump() methods to Loop and MachineLoop.Dan Gohman1-0/+5
llvm-svn: 92772
2009-12-16Explicit template instantiations must happen in the template's immediatelyJohn McCall1-0/+2
enclosing namespace. Caught by clang++. llvm-svn: 91480
2009-12-03improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner1-3/+3
Patch by Howard Hinnant! llvm-svn: 90365
2009-10-20Add getTopBlock and getBottomBlock member functions to MachineLoopInfo.Dan Gohman1-0/+28
llvm-svn: 84596
2009-07-31Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsageDan Gohman1-0/+1
shouldn't do AU.setPreservesCFG(), because even though CodeGen passes don't modify the LLVM IR CFG, they may modify the MachineFunction CFG, and passes like MachineLoop are registered with isCFGOnly set to true. llvm-svn: 77691
2009-07-31Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and manyDaniel Dunbar1-1/+0
failures when building assorted projects with clang. --- Reverse-merging r77654 into '.': U include/llvm/CodeGen/Passes.h U include/llvm/CodeGen/MachineFunctionPass.h U include/llvm/CodeGen/MachineFunction.h U include/llvm/CodeGen/LazyLiveness.h U include/llvm/CodeGen/SelectionDAGISel.h D include/llvm/CodeGen/MachineFunctionAnalysis.h U include/llvm/Function.h U lib/Target/CellSPU/SPUISelDAGToDAG.cpp U lib/Target/PowerPC/PPCISelDAGToDAG.cpp U lib/CodeGen/LLVMTargetMachine.cpp U lib/CodeGen/MachineVerifier.cpp U lib/CodeGen/MachineFunction.cpp U lib/CodeGen/PrologEpilogInserter.cpp U lib/CodeGen/MachineLoopInfo.cpp U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp D lib/CodeGen/MachineFunctionAnalysis.cpp D lib/CodeGen/MachineFunctionPass.cpp U lib/CodeGen/LiveVariables.cpp llvm-svn: 77661
2009-07-31Manage MachineFunctions with an analysis Pass instead of the AnnotableDan Gohman1-0/+1
mechanism. To support this, make MachineFunctionPass a little more complete. llvm-svn: 77654
2009-07-13Make Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,Dan Gohman1-2/+6
using the Curiously Recurring Template Pattern with LoopBase. This will help further refactoring, and future functionality for Loop. Also, Headers can now foward-declare Loop, instead of pulling in LoopInfo.h or doing tricks. llvm-svn: 75519
2009-06-27Eliminate a layer of indirection in LoopInfo and MachineLoopInfo.Dan Gohman1-1/+1
llvm-svn: 74394
2008-05-13Change class' public PassInfo variables to by initialized with theDan Gohman1-1/+1
address of the PassInfo directly instead of calling getPassInfo. This eliminates a bunch of dynamic initializations of static data. Also, fold RegisterPassBase into PassInfo, make a bunch of its data members const, and rearrange some code to initialize data members in constructors instead of using setter member functions. llvm-svn: 51022
2008-05-13Clean up the use of static and anonymous namespaces. This turned upDan Gohman1-4/+2
several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
2008-05-06Remove uses of llvm/System/IncludeFile.h that are no longer needed.Dan Gohman1-3/+0
llvm-svn: 50695
2008-01-05make this build with newer gcc'sChris Lattner1-2/+1
llvm-svn: 45637
2008-01-04Don't recalculate the loop info and loop dominators analyses if they'reBill Wendling1-3/+8
preserved. llvm-svn: 45596
2007-12-29Remove attribution from file headers, per discussion on llvmdev.Chris Lattner1-2/+2
llvm-svn: 45418
2007-11-28Add missing newlines at EOF.Duncan Sands1-1/+1
llvm-svn: 44399
2007-11-27Add MachineLoopInfo. This is not yet tested.Owen Anderson1-0/+41
llvm-svn: 44384