mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
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
This commit is contained in:
@ -38,6 +38,14 @@ namespace llvm {
|
|||||||
FunctionPass *createMachineFunctionPrinterPass(std::ostream *OS,
|
FunctionPass *createMachineFunctionPrinterPass(std::ostream *OS,
|
||||||
const std::string &Banner ="");
|
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
|
/// PHIElimination pass - This pass eliminates machine instruction PHI nodes
|
||||||
/// by inserting copy instructions. This destroys SSA information, but is the
|
/// by inserting copy instructions. This destroys SSA information, but is the
|
||||||
/// desired input for some register allocators. This pass is "required" by
|
/// desired input for some register allocators. This pass is "required" by
|
||||||
|
@ -60,6 +60,8 @@ namespace {
|
|||||||
void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
|
void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
AU.addPreserved<LiveVariables>();
|
AU.addPreserved<LiveVariables>();
|
||||||
AU.addRequired<LiveVariables>();
|
AU.addRequired<LiveVariables>();
|
||||||
|
AU.addPreservedID(MachineLoopInfoID);
|
||||||
|
AU.addPreservedID(MachineDominatorsID);
|
||||||
AU.addPreservedID(PHIEliminationID);
|
AU.addPreservedID(PHIEliminationID);
|
||||||
AU.addRequiredID(PHIEliminationID);
|
AU.addRequiredID(PHIEliminationID);
|
||||||
AU.addRequiredID(TwoAddressInstructionPassID);
|
AU.addRequiredID(TwoAddressInstructionPassID);
|
||||||
|
@ -13,12 +13,17 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/CodeGen/MachineDominators.h"
|
#include "llvm/CodeGen/MachineDominators.h"
|
||||||
|
#include "llvm/CodeGen/Passes.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
TEMPLATE_INSTANTIATION(class DomTreeNodeBase<MachineBasicBlock>);
|
TEMPLATE_INSTANTIATION(class DomTreeNodeBase<MachineBasicBlock>);
|
||||||
TEMPLATE_INSTANTIATION(class DominatorTreeBase<MachineBasicBlock>);
|
TEMPLATE_INSTANTIATION(class DominatorTreeBase<MachineBasicBlock>);
|
||||||
|
|
||||||
char MachineDominatorTree::ID = 0;
|
namespace {
|
||||||
static RegisterPass<MachineDominatorTree>
|
char MachineDominatorTree::ID = 0;
|
||||||
E("machinedomtree", "MachineDominator Tree Construction", true);
|
RegisterPass<MachineDominatorTree>
|
||||||
|
E("machinedomtree", "MachineDominator Tree Construction", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
const PassInfo *llvm::MachineDominatorsID = E.getPassInfo();
|
||||||
|
@ -16,15 +16,20 @@
|
|||||||
|
|
||||||
#include "llvm/CodeGen/MachineLoopInfo.h"
|
#include "llvm/CodeGen/MachineLoopInfo.h"
|
||||||
#include "llvm/CodeGen/MachineDominators.h"
|
#include "llvm/CodeGen/MachineDominators.h"
|
||||||
|
#include "llvm/CodeGen/Passes.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
TEMPLATE_INSTANTIATION(class LoopBase<MachineBasicBlock>);
|
TEMPLATE_INSTANTIATION(class LoopBase<MachineBasicBlock>);
|
||||||
TEMPLATE_INSTANTIATION(class LoopInfoBase<MachineBasicBlock>);
|
TEMPLATE_INSTANTIATION(class LoopInfoBase<MachineBasicBlock>);
|
||||||
|
|
||||||
char MachineLoopInfo::ID = 0;
|
namespace {
|
||||||
static RegisterPass<MachineLoopInfo>
|
char MachineLoopInfo::ID = 0;
|
||||||
X("machine-loops", "Machine Natural Loop Construction", true);
|
RegisterPass<MachineLoopInfo>
|
||||||
|
X("machine-loops", "Machine Natural Loop Construction", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
const PassInfo *llvm::MachineLoopInfoID = X.getPassInfo();
|
||||||
|
|
||||||
bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) {
|
bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) {
|
||||||
releaseMemory();
|
releaseMemory();
|
||||||
|
@ -51,6 +51,8 @@ namespace {
|
|||||||
|
|
||||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
AU.addPreserved<LiveVariables>();
|
AU.addPreserved<LiveVariables>();
|
||||||
|
AU.addPreservedID(MachineLoopInfoID);
|
||||||
|
AU.addPreservedID(MachineDominatorsID);
|
||||||
MachineFunctionPass::getAnalysisUsage(AU);
|
MachineFunctionPass::getAnalysisUsage(AU);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +104,8 @@ namespace {
|
|||||||
// to coalescing and which analyses coalescing invalidates.
|
// to coalescing and which analyses coalescing invalidates.
|
||||||
AU.addRequiredTransitive<RegisterCoalescer>();
|
AU.addRequiredTransitive<RegisterCoalescer>();
|
||||||
AU.addRequired<MachineLoopInfo>();
|
AU.addRequired<MachineLoopInfo>();
|
||||||
|
AU.addPreserved<MachineLoopInfo>();
|
||||||
|
AU.addPreservedID(MachineDominatorsID);
|
||||||
MachineFunctionPass::getAnalysisUsage(AU);
|
MachineFunctionPass::getAnalysisUsage(AU);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +67,8 @@ const PassInfo *llvm::SimpleRegisterCoalescingID = X.getPassInfo();
|
|||||||
|
|
||||||
void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const {
|
void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
AU.addPreserved<LiveIntervals>();
|
AU.addPreserved<LiveIntervals>();
|
||||||
|
AU.addPreserved<MachineLoopInfo>();
|
||||||
|
AU.addPreservedID(MachineDominatorsID);
|
||||||
AU.addPreservedID(PHIEliminationID);
|
AU.addPreservedID(PHIEliminationID);
|
||||||
AU.addPreservedID(TwoAddressInstructionPassID);
|
AU.addPreservedID(TwoAddressInstructionPassID);
|
||||||
AU.addRequired<LiveVariables>();
|
AU.addRequired<LiveVariables>();
|
||||||
|
@ -69,6 +69,8 @@ const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo();
|
|||||||
void TwoAddressInstructionPass::getAnalysisUsage(AnalysisUsage &AU) const {
|
void TwoAddressInstructionPass::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
AU.addRequired<LiveVariables>();
|
AU.addRequired<LiveVariables>();
|
||||||
AU.addPreserved<LiveVariables>();
|
AU.addPreserved<LiveVariables>();
|
||||||
|
AU.addPreservedID(MachineLoopInfoID);
|
||||||
|
AU.addPreservedID(MachineDominatorsID);
|
||||||
AU.addPreservedID(PHIEliminationID);
|
AU.addPreservedID(PHIEliminationID);
|
||||||
MachineFunctionPass::getAnalysisUsage(AU);
|
MachineFunctionPass::getAnalysisUsage(AU);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user