mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-27 05:30:29 +00:00
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that are to show up in opt or analyze * Register Analyses now * Change optimizations to use RegisterOpt instead of RegisterPass * Add support for different "PassType's" * Add new RegisterOpt/RegisterAnalysis templates for registering passes that are to show up in opt or analyze * Register Analyses now * Change optimizations to use RegisterOpt instead of RegisterPass * Remove getPassName implementations from various subclasses git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3112 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5d549083e2
commit
1e43516dcf
@ -22,7 +22,6 @@ public:
|
||||
//
|
||||
BasicBlock *getExitNode() const { return ExitNode; }
|
||||
|
||||
virtual const char *getPassName() const { return "Unify Function Exit Nodes";}
|
||||
virtual bool runOnFunction(Function &F);
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addProvided(ID); }
|
||||
};
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include "Support/StatisticReporter.h"
|
||||
using std::map;
|
||||
|
||||
static RegisterAnalysis<BUDataStructures>
|
||||
X("budatastructure", "Bottom-Up Data Structure Analysis Closure");
|
||||
AnalysisID BUDataStructures::ID(AnalysisID::create<BUDataStructures>());
|
||||
|
||||
// releaseMemory - If the pass pipeline is done with this pass, we can release
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
using std::vector;
|
||||
|
||||
static RegisterAnalysis<LocalDataStructures>
|
||||
X("datastructure", "Local Data Structure Analysis");
|
||||
AnalysisID LocalDataStructures::ID(AnalysisID::create<LocalDataStructures>());
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -40,13 +40,12 @@
|
||||
|
||||
#include "llvm/Analysis/CallGraph.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/BasicBlock.h"
|
||||
#include "llvm/iOther.h"
|
||||
#include "llvm/iTerminators.h"
|
||||
#include "Support/STLExtras.h"
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
static RegisterAnalysis<CallGraph> X("callgraph", "Call Graph Construction");
|
||||
|
||||
AnalysisID CallGraph::ID(AnalysisID::create<CallGraph>());
|
||||
|
||||
|
@ -10,6 +10,9 @@
|
||||
|
||||
using std::make_pair;
|
||||
|
||||
static RegisterAnalysis<IntervalPartition>
|
||||
X("intervals", "Interval Partition Construction");
|
||||
|
||||
AnalysisID IntervalPartition::ID(AnalysisID::create<IntervalPartition>(), true);
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include "Support/CommandLine.h"
|
||||
#include <iostream>
|
||||
|
||||
static RegisterAnalysis<FunctionLiveVarInfo>
|
||||
X("livevar", "Live Variable Analysis");
|
||||
AnalysisID FunctionLiveVarInfo::ID(AnalysisID::create<FunctionLiveVarInfo>());
|
||||
|
||||
LiveVarDebugLevel_t DEBUG_LV;
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include "Support/DepthFirstIterator.h"
|
||||
#include <algorithm>
|
||||
|
||||
static RegisterAnalysis<LoopInfo>
|
||||
X("loops", "Natural Loop Construction");
|
||||
AnalysisID LoopInfo::ID(AnalysisID::create<LoopInfo>(), true);
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -18,6 +18,11 @@ using std::set;
|
||||
// DominatorSet Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static RegisterAnalysis<DominatorSet>
|
||||
A("domset", "Dominator Set Construction");
|
||||
static RegisterAnalysis<PostDominatorSet>
|
||||
B("postdomset", "Post-Dominator Set Construction");
|
||||
|
||||
AnalysisID DominatorSet::ID(AnalysisID::create<DominatorSet>(), true);
|
||||
AnalysisID PostDominatorSet::ID(AnalysisID::create<PostDominatorSet>(), true);
|
||||
|
||||
@ -151,6 +156,11 @@ void PostDominatorSet::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
// ImmediateDominators Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static RegisterAnalysis<ImmediateDominators>
|
||||
C("idom", "Immediate Dominators Construction");
|
||||
static RegisterAnalysis<ImmediatePostDominators>
|
||||
D("postidom", "Immediate Post-Dominators Construction");
|
||||
|
||||
AnalysisID ImmediateDominators::ID(AnalysisID::create<ImmediateDominators>(), true);
|
||||
AnalysisID ImmediatePostDominators::ID(AnalysisID::create<ImmediatePostDominators>(), true);
|
||||
|
||||
@ -195,6 +205,11 @@ void ImmediateDominatorsBase::calcIDoms(const DominatorSetBase &DS) {
|
||||
// DominatorTree Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static RegisterAnalysis<DominatorTree>
|
||||
E("domtree", "Dominator Tree Construction");
|
||||
static RegisterAnalysis<PostDominatorTree>
|
||||
F("postdomtree", "Post-Dominator Tree Construction");
|
||||
|
||||
AnalysisID DominatorTree::ID(AnalysisID::create<DominatorTree>(), true);
|
||||
AnalysisID PostDominatorTree::ID(AnalysisID::create<PostDominatorTree>(), true);
|
||||
|
||||
@ -307,6 +322,11 @@ void PostDominatorTree::calculate(const PostDominatorSet &DS) {
|
||||
// DominanceFrontier Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static RegisterAnalysis<DominanceFrontier>
|
||||
G("domfrontier", "Dominance Frontier Construction");
|
||||
static RegisterAnalysis<PostDominanceFrontier>
|
||||
H("postdomfrontier", "Post-Dominance Frontier Construction");
|
||||
|
||||
AnalysisID DominanceFrontier::ID(AnalysisID::create<DominanceFrontier>(), true);
|
||||
AnalysisID PostDominanceFrontier::ID(AnalysisID::create<PostDominanceFrontier>(), true);
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include "Support/CommandLine.h"
|
||||
#include <iostream>
|
||||
|
||||
static RegisterAnalysis<FunctionLiveVarInfo>
|
||||
X("livevar", "Live Variable Analysis");
|
||||
AnalysisID FunctionLiveVarInfo::ID(AnalysisID::create<FunctionLiveVarInfo>());
|
||||
|
||||
LiveVarDebugLevel_t DEBUG_LV;
|
||||
|
@ -31,8 +31,8 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
Statistic<> NumMerged("constmerge\t\t- Number of global constants merged");
|
||||
RegisterPass<ConstantMerge> X("constmerge", "Merge Duplicate Global Constants");
|
||||
Statistic<> NumMerged("constmerge\t\t- Number of global constants merged");
|
||||
RegisterOpt<ConstantMerge> X("constmerge","Merge Duplicate Global Constants");
|
||||
}
|
||||
|
||||
Pass *createConstantMergePass() { return new ConstantMerge(); }
|
||||
|
@ -30,7 +30,7 @@ namespace {
|
||||
AU.addRequired(FindUsedTypes::ID);
|
||||
}
|
||||
};
|
||||
RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination");
|
||||
RegisterOpt<DTE> X("deadtypeelim", "Dead Type Elimination");
|
||||
Statistic<> NumKilled("deadtypeelim\t- Number of unused typenames removed from symtab");
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace {
|
||||
struct FunctionResolvingPass : public Pass {
|
||||
bool run(Module &M);
|
||||
};
|
||||
RegisterPass<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
|
||||
RegisterOpt<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
|
||||
}
|
||||
|
||||
Pass *createFunctionResolvingPass() {
|
||||
|
@ -86,7 +86,7 @@ namespace {
|
||||
AU.addRequired(CallGraph::ID);
|
||||
}
|
||||
};
|
||||
RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination");
|
||||
RegisterOpt<GlobalDCE> X("globaldce", "Dead Global Elimination");
|
||||
}
|
||||
|
||||
Pass *createGlobalDCEPass() { return new GlobalDCE(); }
|
||||
|
@ -41,7 +41,7 @@ class InternalizePass : public Pass {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterPass<InternalizePass> X("internalize", "Internalize Functions");
|
||||
RegisterOpt<InternalizePass> X("internalize", "Internalize Functions");
|
||||
} // end anonymous namespace
|
||||
|
||||
Pass *createInternalizePass() {
|
||||
|
@ -315,8 +315,8 @@ namespace {
|
||||
|
||||
};
|
||||
|
||||
RegisterPass<PoolAllocate> X("poolalloc",
|
||||
"Pool allocate disjoint datastructures");
|
||||
RegisterOpt<PoolAllocate> X("poolalloc",
|
||||
"Pool allocate disjoint datastructures");
|
||||
}
|
||||
|
||||
// isNotPoolableAlloc - This is a predicate that returns true if the specified
|
||||
|
@ -189,10 +189,10 @@ Pass *createSortElementsPass(const TargetData &TD) {
|
||||
}
|
||||
|
||||
namespace {
|
||||
RegisterPass<SwapStructElements> X("swapstructs",
|
||||
"Swap structure types around",
|
||||
createSwapElementsPass);
|
||||
RegisterPass<SortStructElements> Y("sortstructs",
|
||||
"Sort structure elements by size",
|
||||
createSortElementsPass);
|
||||
RegisterOpt<SwapStructElements> X("swapstructs",
|
||||
"Swap structure types around",
|
||||
createSwapElementsPass);
|
||||
RegisterOpt<SortStructElements> Y("sortstructs",
|
||||
"Sort structure elements by size",
|
||||
createSortElementsPass);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ struct ProfilePaths : public FunctionPass {
|
||||
}
|
||||
};
|
||||
|
||||
static RegisterPass<ProfilePaths> X("paths", "Profile Paths");
|
||||
static RegisterOpt<ProfilePaths> X("paths", "Profile Paths");
|
||||
|
||||
// createProfilePathsPass - Create a new pass to add path profiling
|
||||
//
|
||||
|
@ -17,7 +17,7 @@ using std::vector;
|
||||
|
||||
AnalysisID UnifyFunctionExitNodes::ID(AnalysisID::create<UnifyFunctionExitNodes>());
|
||||
|
||||
static RegisterPass<UnifyFunctionExitNodes>
|
||||
static RegisterOpt<UnifyFunctionExitNodes>
|
||||
X("mergereturn", "Unify function exit nodes");
|
||||
|
||||
// UnifyAllExitNodes - Unify all exit nodes of the CFG by creating a new
|
||||
|
@ -18,6 +18,11 @@ using std::set;
|
||||
// DominatorSet Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static RegisterAnalysis<DominatorSet>
|
||||
A("domset", "Dominator Set Construction");
|
||||
static RegisterAnalysis<PostDominatorSet>
|
||||
B("postdomset", "Post-Dominator Set Construction");
|
||||
|
||||
AnalysisID DominatorSet::ID(AnalysisID::create<DominatorSet>(), true);
|
||||
AnalysisID PostDominatorSet::ID(AnalysisID::create<PostDominatorSet>(), true);
|
||||
|
||||
@ -151,6 +156,11 @@ void PostDominatorSet::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
// ImmediateDominators Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static RegisterAnalysis<ImmediateDominators>
|
||||
C("idom", "Immediate Dominators Construction");
|
||||
static RegisterAnalysis<ImmediatePostDominators>
|
||||
D("postidom", "Immediate Post-Dominators Construction");
|
||||
|
||||
AnalysisID ImmediateDominators::ID(AnalysisID::create<ImmediateDominators>(), true);
|
||||
AnalysisID ImmediatePostDominators::ID(AnalysisID::create<ImmediatePostDominators>(), true);
|
||||
|
||||
@ -195,6 +205,11 @@ void ImmediateDominatorsBase::calcIDoms(const DominatorSetBase &DS) {
|
||||
// DominatorTree Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static RegisterAnalysis<DominatorTree>
|
||||
E("domtree", "Dominator Tree Construction");
|
||||
static RegisterAnalysis<PostDominatorTree>
|
||||
F("postdomtree", "Post-Dominator Tree Construction");
|
||||
|
||||
AnalysisID DominatorTree::ID(AnalysisID::create<DominatorTree>(), true);
|
||||
AnalysisID PostDominatorTree::ID(AnalysisID::create<PostDominatorTree>(), true);
|
||||
|
||||
@ -307,6 +322,11 @@ void PostDominatorTree::calculate(const PostDominatorSet &DS) {
|
||||
// DominanceFrontier Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static RegisterAnalysis<DominanceFrontier>
|
||||
G("domfrontier", "Dominance Frontier Construction");
|
||||
static RegisterAnalysis<PostDominanceFrontier>
|
||||
H("postdomfrontier", "Post-Dominance Frontier Construction");
|
||||
|
||||
AnalysisID DominanceFrontier::ID(AnalysisID::create<DominanceFrontier>(), true);
|
||||
AnalysisID PostDominanceFrontier::ID(AnalysisID::create<PostDominanceFrontier>(), true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user