llvm.org GIT mirror llvm / 67d65bb
Don't recalculate the loop info and loop dominators analyses if they're preserved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45596 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 12 years ago
8 changed file(s) with 34 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
3636 /// standard error, as a debugging tool.
3737 FunctionPass *createMachineFunctionPrinterPass(std::ostream *OS,
3838 const std::string &Banner ="");
39
40 /// MachineLoopInfo pass - This pass is a loop analysis pass.
41 ///
42 extern const PassInfo *MachineLoopInfoID;
43
44 /// MachineDominators pass - This pass is a machine dominators analysis pass.
45 ///
46 extern const PassInfo *MachineDominatorsID;
3947
4048 /// PHIElimination pass - This pass eliminates machine instruction PHI nodes
4149 /// by inserting copy instructions. This destroys SSA information, but is the
5959 void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
6060 AU.addPreserved();
6161 AU.addRequired();
62 AU.addPreservedID(MachineLoopInfoID);
63 AU.addPreservedID(MachineDominatorsID);
6264 AU.addPreservedID(PHIEliminationID);
6365 AU.addRequiredID(PHIEliminationID);
6466 AU.addRequiredID(TwoAddressInstructionPassID);
1212 //===----------------------------------------------------------------------===//
1313
1414 #include "llvm/CodeGen/MachineDominators.h"
15 #include "llvm/CodeGen/Passes.h"
1516
1617 using namespace llvm;
1718
1819 TEMPLATE_INSTANTIATION(class DomTreeNodeBase);
1920 TEMPLATE_INSTANTIATION(class DominatorTreeBase);
2021
21 char MachineDominatorTree::ID = 0;
22 static RegisterPass
23 E("machinedomtree", "MachineDominator Tree Construction", true);
22 namespace {
23 char MachineDominatorTree::ID = 0;
24 RegisterPass
25 E("machinedomtree", "MachineDominator Tree Construction", true);
26 }
27
28 const PassInfo *llvm::MachineDominatorsID = E.getPassInfo();
1515
1616 #include "llvm/CodeGen/MachineLoopInfo.h"
1717 #include "llvm/CodeGen/MachineDominators.h"
18 #include "llvm/CodeGen/Passes.h"
1819
1920 using namespace llvm;
2021
2122 TEMPLATE_INSTANTIATION(class LoopBase);
2223 TEMPLATE_INSTANTIATION(class LoopInfoBase);
2324
24 char MachineLoopInfo::ID = 0;
25 static RegisterPass
26 X("machine-loops", "Machine Natural Loop Construction", true);
25 namespace {
26 char MachineLoopInfo::ID = 0;
27 RegisterPass
28 X("machine-loops", "Machine Natural Loop Construction", true);
29 }
30
31 const PassInfo *llvm::MachineLoopInfoID = X.getPassInfo();
2732
2833 bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) {
2934 releaseMemory();
5050
5151 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
5252 AU.addPreserved();
53 AU.addPreservedID(MachineLoopInfoID);
54 AU.addPreservedID(MachineDominatorsID);
5355 MachineFunctionPass::getAnalysisUsage(AU);
5456 }
5557
103103 // to coalescing and which analyses coalescing invalidates.
104104 AU.addRequiredTransitive();
105105 AU.addRequired();
106 AU.addPreserved();
107 AU.addPreservedID(MachineDominatorsID);
106108 MachineFunctionPass::getAnalysisUsage(AU);
107109 }
108110
6666
6767 void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const {
6868 AU.addPreserved();
69 AU.addPreserved();
70 AU.addPreservedID(MachineDominatorsID);
6971 AU.addPreservedID(PHIEliminationID);
7072 AU.addPreservedID(TwoAddressInstructionPassID);
7173 AU.addRequired();
6868 void TwoAddressInstructionPass::getAnalysisUsage(AnalysisUsage &AU) const {
6969 AU.addRequired();
7070 AU.addPreserved();
71 AU.addPreservedID(MachineLoopInfoID);
72 AU.addPreservedID(MachineDominatorsID);
7173 AU.addPreservedID(PHIEliminationID);
7274 MachineFunctionPass::getAnalysisUsage(AU);
7375 }