14 #ifndef LLVM_IR_LEGACYPASSMANAGERS_H
15 #define LLVM_IR_LEGACYPASSMANAGERS_H
94 template <
typename T>
class ArrayRef;
124 : P(p), V(nullptr), M(nullptr) {}
126 : P(p), V(&v), M(nullptr) {}
128 : P(p), V(nullptr), M(&m) {}
146 typedef std::vector<PMDataManager *>::const_reverse_iterator
iterator;
153 bool empty()
const {
return S.empty(); }
158 std::vector<PMDataManager *> S;
209 return ImmutablePasses;
219 IndirectPassManagers.push_back(Manager);
332 void add(
Pass *
P,
bool ProcessAnalysis =
true);
343 AvailableAnalysis.clear();
374 void setDepth(
unsigned newDepth) { Depth = newDepth; }
390 assert ( 0 &&
"Invalid use of getPassManagerType");
395 return &AvailableAnalysis;
Pass interface - Implemented by all 'passes'.
bool preserveHigherLevelAnalysis(Pass *P)
void AddPointer(const void *Ptr)
Add* - Add various data types to Bit data.
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
PassManagerType
Different types of internal pass managers.
void initializeAllAnalysisInfo()
PassManagerPrettyStackEntry(Pass *p, Value &v)
Pass * findAnalysisPass(AnalysisID AID, bool Direction)
Find the pass that implements Analysis AID.
void dumpLastUses(Pass *P, unsigned Offset) const
A Module instance is used to store all the information related to an LLVM module. ...
bool doInitialization(Module &M) override
doInitialization - Run all of the initializers for the function passes.
aarch64 AArch64 CCMP Pass
std::vector< PMDataManager * >::const_reverse_iterator iterator
unsigned getNumContainedManagers() const
const VectorType & getPreservedSet() const
void dumpRequiredSet(const Pass *P) const
PMDataManager * getAsPMDataManager() override
PMTopLevelManager(PMDataManager *PMDM)
Initialize top level manager. Create first pass manager.
void dumpUsedSet(const Pass *P) const
void dumpPassInfo(Pass *P, enum PassDebuggingString S1, enum PassDebuggingString S2, StringRef Msg)
virtual PassManagerType getPassManagerType() const
DenseMap< AnalysisID, Pass * > * InheritedAnalysis[PMT_Last]
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers...
Timer * getPassTimer(Pass *)
If TimingInfo is enabled then start pass timer.
void setDepth(unsigned newDepth)
void addPassManager(PMDataManager *Manager)
void schedulePass(Pass *P)
Schedule pass P for execution.
void freePass(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove P.
void dumpPassStructure(unsigned Offset) override
Print passes managed by this manager.
bool isPassDebuggingExecutionsOrMore() const
isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions or higher is specified...
virtual ~PMTopLevelManager()
Destructor.
virtual bool doFinalization(Module &)
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void verifyPreservedAnalysis(Pass *P)
verifyPreservedAnalysis – Verify analysis presreved by pass P.
void initializeAnalysisInfo()
Initialize available analysis information.
void AddInteger(signed I)
virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass)
Add RequiredPass into list of lower level passes required by pass P.
void populateInheritedAnalysis(PMStack &PMS)
FPPassManager manages BBPassManagers and FunctionPasses.
PMStack - This class implements a stack data structure of PMDataManager pointers. ...
void initializeAnalysisImpl(Pass *P)
All Required analyses should be available to the pass as it runs! Here we fill in the AnalysisImpls m...
PassManagerPrettyStackEntry - This is used to print informative information about what pass is runnin...
unsigned getDepth() const
PassManagerPrettyStackEntry(Pass *p, Module &m)
void add(Pass *P, bool ProcessAnalysis=true)
Add pass P into the PassVector.
unsigned getNumContainedPasses() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
virtual Pass * getAsPass()=0
bool doFinalization(Module &M) override
doFinalization - Run all of the finalizers for the function passes.
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
void dumpPreservedSet(const Pass *P) const
void print(raw_ostream &OS) const override
print - Emit information about this stack frame to OS.
const VectorType & getRequiredTransitiveSet() const
void addIndirectPassManager(PMDataManager *Manager)
void collectLastUses(SmallVectorImpl< Pass * > &LastUses, Pass *P)
Collect passes whose last user is P.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
SmallVectorImpl< ImmutablePass * > & getImmutablePasses()
const VectorType & getUsedSet() const
PassManagerPrettyStackEntry(Pass *p)
PassInfo class - An instance of this class exists for every pass known by the system, and can be obtained from a live Pass by calling its getPassInfo() method.
PrettyStackTraceEntry - This class is used to represent a frame of the "pretty" stack trace that is d...
bool runOnModule(Module &M) override
runOnModule - Virtual method overriden by subclasses to process the module being operated on...
void addImmutablePass(ImmutablePass *P)
Add immutable pass and initialize it.
void setLastUser(ArrayRef< Pass * > AnalysisPasses, Pass *P)
Set pass P as the last user of the given analysis passes.
void collectRequiredAndUsedAnalyses(SmallVectorImpl< Pass * > &UsedPasses, SmallVectorImpl< AnalysisID > &ReqPassNotAvailable, Pass *P)
Populate UsedPasses with analysis pass that are used or required by pass P and are available...
ImmutablePass class - This class is used to provide information that does not need to be run...
void recordAvailableAnalysis(Pass *P)
Augment AvailableAnalysis by adding analysis made available by pass P.
bool getPreservesAll() const
Determine whether a pass said it does not transform its input at all.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void removeNotPreservedAnalysis(Pass *P)
Remove Analysis that is not preserved by the pass.
bool runOnFunction(Function &F)
run - Execute all of the passes scheduled for execution.
void removeDeadPasses(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove dead passes used by P.
virtual Pass * getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F)
Node - This class is used to maintain the singly linked bucket list in a folding set.
SmallVector< Pass *, 16 > PassVector
PMDataManager * top() const
Pass * getAsPass() override
void getAnalysisUsage(AnalysisUsage &Info) const override
Pass Manager itself does not invalidate any analysis info.
DenseMap< AnalysisID, Pass * > * getAvailableAnalysis()
void setPreservesAll()
Set by analyses that do not transform their input at all.
AnalysisUsage * findAnalysisUsage(Pass *P)
Find analysis usage information for the pass P.
const PassInfo * findAnalysisPassInfo(AnalysisID AID) const
Retrieve the PassInfo for an analysis.
void setTopLevelManager(PMTopLevelManager *T)
SmallVector< PMDataManager *, 8 > PassManagers
Collection of pass managers.
const VectorType & getRequiredSet() const
FunctionPass * getContainedPass(unsigned N)
void cleanup()
cleanup - After running all passes, clean up pass manager cache.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
void dumpArguments() const
void push(PMDataManager *PM)
PMDataManager provides the common place to manage the analysis data used by pass managers.
Pass * findAnalysisPass(AnalysisID AID)
Find the pass that implements Analysis AID.
void dumpPassArguments() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
PMTopLevelManager * getTopLevelManager()
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
PassManagerType getPassManagerType() const override