Author: void Date: Fri Jan 4 14:54:55 2008 New Revision: 45596 URL: http://llvm.org/viewvc/llvm-project?rev=45596&view=rev Log: Don't recalculate the loop info and loop dominators analyses if they're preserved.
Modified: llvm/trunk/include/llvm/CodeGen/Passes.h llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/MachineDominators.cpp llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp llvm/trunk/lib/CodeGen/PHIElimination.cpp llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=45596&r1=45595&r2=45596&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Fri Jan 4 14:54:55 2008 @@ -38,6 +38,14 @@ FunctionPass *createMachineFunctionPrinterPass(std::ostream *OS, const std::string &Banner =""); + /// MachineLoopInfo pass - This pass is a loop analysis pass. + /// + extern const PassInfo *MachineLoopInfoID; + + /// MachineDominators pass - This pass is a machine dominators analysis pass. + /// + extern const PassInfo *MachineDominatorsID; + /// PHIElimination pass - This pass eliminates machine instruction PHI nodes /// by inserting copy instructions. This destroys SSA information, but is the /// desired input for some register allocators. This pass is "required" by Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=45596&r1=45595&r2=45596&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Fri Jan 4 14:54:55 2008 @@ -60,6 +60,8 @@ void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved<LiveVariables>(); AU.addRequired<LiveVariables>(); + AU.addPreservedID(MachineLoopInfoID); + AU.addPreservedID(MachineDominatorsID); AU.addPreservedID(PHIEliminationID); AU.addRequiredID(PHIEliminationID); AU.addRequiredID(TwoAddressInstructionPassID); Modified: llvm/trunk/lib/CodeGen/MachineDominators.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineDominators.cpp?rev=45596&r1=45595&r2=45596&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineDominators.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineDominators.cpp Fri Jan 4 14:54:55 2008 @@ -13,12 +13,17 @@ //===----------------------------------------------------------------------===// #include "llvm/CodeGen/MachineDominators.h" +#include "llvm/CodeGen/Passes.h" using namespace llvm; TEMPLATE_INSTANTIATION(class DomTreeNodeBase<MachineBasicBlock>); TEMPLATE_INSTANTIATION(class DominatorTreeBase<MachineBasicBlock>); -char MachineDominatorTree::ID = 0; -static RegisterPass<MachineDominatorTree> -E("machinedomtree", "MachineDominator Tree Construction", true); +namespace { + char MachineDominatorTree::ID = 0; + RegisterPass<MachineDominatorTree> + E("machinedomtree", "MachineDominator Tree Construction", true); +} + +const PassInfo *llvm::MachineDominatorsID = E.getPassInfo(); Modified: llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp?rev=45596&r1=45595&r2=45596&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp Fri Jan 4 14:54:55 2008 @@ -16,15 +16,20 @@ #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineDominators.h" +#include "llvm/CodeGen/Passes.h" using namespace llvm; TEMPLATE_INSTANTIATION(class LoopBase<MachineBasicBlock>); TEMPLATE_INSTANTIATION(class LoopInfoBase<MachineBasicBlock>); -char MachineLoopInfo::ID = 0; -static RegisterPass<MachineLoopInfo> -X("machine-loops", "Machine Natural Loop Construction", true); +namespace { + char MachineLoopInfo::ID = 0; + RegisterPass<MachineLoopInfo> + X("machine-loops", "Machine Natural Loop Construction", true); +} + +const PassInfo *llvm::MachineLoopInfoID = X.getPassInfo(); bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) { releaseMemory(); Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=45596&r1=45595&r2=45596&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Fri Jan 4 14:54:55 2008 @@ -51,6 +51,8 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved<LiveVariables>(); + AU.addPreservedID(MachineLoopInfoID); + AU.addPreservedID(MachineDominatorsID); MachineFunctionPass::getAnalysisUsage(AU); } Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=45596&r1=45595&r2=45596&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Fri Jan 4 14:54:55 2008 @@ -104,6 +104,8 @@ // to coalescing and which analyses coalescing invalidates. AU.addRequiredTransitive<RegisterCoalescer>(); AU.addRequired<MachineLoopInfo>(); + AU.addPreserved<MachineLoopInfo>(); + AU.addPreservedID(MachineDominatorsID); MachineFunctionPass::getAnalysisUsage(AU); } Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=45596&r1=45595&r2=45596&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Fri Jan 4 14:54:55 2008 @@ -67,6 +67,8 @@ void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved<LiveIntervals>(); + AU.addPreserved<MachineLoopInfo>(); + AU.addPreservedID(MachineDominatorsID); AU.addPreservedID(PHIEliminationID); AU.addPreservedID(TwoAddressInstructionPassID); AU.addRequired<LiveVariables>(); Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=45596&r1=45595&r2=45596&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Fri Jan 4 14:54:55 2008 @@ -69,6 +69,8 @@ void TwoAddressInstructionPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<LiveVariables>(); AU.addPreserved<LiveVariables>(); + AU.addPreservedID(MachineLoopInfoID); + AU.addPreservedID(MachineDominatorsID); AU.addPreservedID(PHIEliminationID); MachineFunctionPass::getAnalysisUsage(AU); } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits