13#ifndef LLVM_IR_LEGACYPASSMANAGERS_H
14#define LLVM_IR_LEGACYPASSMANAGERS_H
116 :
P(p), V(nullptr), M(nullptr) {}
118 :
P(p), V(&v), M(nullptr) {}
120 :
P(p), V(nullptr), M(&m) {}
138 typedef std::vector<PMDataManager *>::const_reverse_iterator
iterator;
145 bool empty()
const {
return S.empty(); }
150 std::vector<PMDataManager *> S;
201 return ImmutablePasses;
211 IndirectPassManagers.push_back(Manager);
259 ID.AddInteger(Vec.size());
322 void add(
Pass *
P,
bool ProcessAnalysis =
true);
334 AvailableAnalysis.clear();
365 void setDepth(
unsigned newDepth) { Depth = newDepth; }
381 assert ( 0 &&
"Invalid use of getPassManagerType");
386 return &AvailableAnalysis;
401 StringMap<std::pair<unsigned, unsigned>> &FunctionToInstrCount);
413 Pass *
P,
Module &M, int64_t Delta,
unsigned CountBefore,
414 StringMap<std::pair<unsigned, unsigned>> &FunctionToInstrCount,
493 Info.setPreservesAll();
Analysis containing CSE Info
This file defines the DenseMap class.
This file defines a hash set that can be used to remove duplication of nodes in a graph.
Loop::LoopBounds::Direction Direction
Machine Check Debug Module
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallPtrSet class.
This file defines the SmallVector class.
Represent the analysis usage information of a pass.
const VectorType & getRequiredSet() const
const VectorType & getRequiredTransitiveSet() const
const VectorType & getUsedSet() const
bool getPreservesAll() const
Determine whether a pass said it does not transform its input at all.
const VectorType & getPreservedSet() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
FPPassManager manages BBPassManagers and FunctionPasses.
bool runOnFunction(Function &F)
run - Execute all of the passes scheduled for execution.
bool doInitialization(Module &M) override
doInitialization - Run all of the initializers for the function passes.
bool doFinalization(Module &M) override
doFinalization - Run all of the finalizers for the function passes.
FunctionPass * getContainedPass(unsigned N)
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Pass * getAsPass() override
PassManagerType getPassManagerType() const override
void getAnalysisUsage(AnalysisUsage &Info) const override
Pass Manager itself does not invalidate any analysis info.
void dumpPassStructure(unsigned Offset) override
Print passes managed by this manager.
bool runOnModule(Module &M) override
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
PMDataManager * getAsPMDataManager() override
void cleanup()
cleanup - After running all passes, clean up pass manager cache.
Node - This class is used to maintain the singly linked bucket list in a folding set.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
FunctionPass class - This class is used to implement most global optimizations.
ImmutablePass class - This class is used to provide information that does not need to be run.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
A Module instance is used to store all the information related to an LLVM module.
PMDataManager provides the common place to manage the analysis data used by pass managers.
void dumpPassArguments() const
void removeDeadPasses(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove dead passes used by P.
void dumpLastUses(Pass *P, unsigned Offset) const
virtual Pass * getAsPass()=0
virtual std::tuple< Pass *, bool > getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F)
void setDepth(unsigned newDepth)
void recordAvailableAnalysis(Pass *P)
Augment AvailableAnalysis by adding analysis made available by pass P.
Pass * findAnalysisPass(AnalysisID AID, bool Direction)
Find the pass that implements Analysis AID.
bool isPassDebuggingExecutionsOrMore() const
isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions or higher is specified.
unsigned getDepth() const
SmallVector< Pass *, 16 > PassVector
DenseMap< AnalysisID, Pass * > * InheritedAnalysis[PMT_Last]
virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass)
Add RequiredPass into list of lower level passes required by pass P.
PMTopLevelManager * getTopLevelManager()
unsigned initSizeRemarkInfo(Module &M, StringMap< std::pair< unsigned, unsigned > > &FunctionToInstrCount)
Set the initial size of the module if the user has specified that they want remarks for size.
void setTopLevelManager(PMTopLevelManager *T)
void dumpRequiredSet(const Pass *P) const
void initializeAnalysisImpl(Pass *P)
All Required analyses should be available to the pass as it runs! Here we fill in the AnalysisImpls m...
void verifyPreservedAnalysis(Pass *P)
verifyPreservedAnalysis – Verify analysis presreved by pass P.
void initializeAnalysisInfo()
Initialize available analysis information.
void freePass(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove P.
bool preserveHigherLevelAnalysis(Pass *P)
unsigned getNumContainedPasses() const
virtual PassManagerType getPassManagerType() const
void emitInstrCountChangedRemark(Pass *P, Module &M, int64_t Delta, unsigned CountBefore, StringMap< std::pair< unsigned, unsigned > > &FunctionToInstrCount, Function *F=nullptr)
Emit a remark signifying that the number of IR instructions in the module changed.
void add(Pass *P, bool ProcessAnalysis=true)
Add pass P into the PassVector.
DenseMap< AnalysisID, Pass * > * getAvailableAnalysis()
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.
void populateInheritedAnalysis(PMStack &PMS)
void dumpPreservedSet(const Pass *P) const
void dumpUsedSet(const Pass *P) const
void removeNotPreservedAnalysis(Pass *P)
Remove Analysis that is not preserved by the pass.
void dumpPassInfo(Pass *P, enum PassDebuggingString S1, enum PassDebuggingString S2, StringRef Msg)
PMStack - This class implements a stack data structure of PMDataManager pointers.
std::vector< PMDataManager * >::const_reverse_iterator iterator
PMDataManager * top() const
void push(PMDataManager *PM)
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers.
void addIndirectPassManager(PMDataManager *Manager)
void addImmutablePass(ImmutablePass *P)
Add immutable pass and initialize it.
const PassInfo * findAnalysisPassInfo(AnalysisID AID) const
Retrieve the PassInfo for an analysis.
void setLastUser(ArrayRef< Pass * > AnalysisPasses, Pass *P)
Set pass P as the last user of the given analysis passes.
virtual ~PMTopLevelManager()
Destructor.
void schedulePass(Pass *P)
Schedule pass P for execution.
SmallVector< PMDataManager *, 8 > PassManagers
Collection of pass managers.
Pass * findAnalysisPass(AnalysisID AID)
Find the pass that implements Analysis AID.
void dumpArguments() const
AnalysisUsage * findAnalysisUsage(Pass *P)
Find analysis usage information for the pass P.
void addPassManager(PMDataManager *Manager)
unsigned getNumContainedManagers() const
void initializeAllAnalysisInfo()
SmallVectorImpl< ImmutablePass * > & getImmutablePasses()
void collectLastUses(SmallVectorImpl< Pass * > &LastUses, Pass *P)
Collect passes whose last user is P.
PassInfo class - An instance of this class exists for every pass known by the system,...
PassManagerPrettyStackEntry - This is used to print informative information about what pass is runnin...
PassManagerPrettyStackEntry(Pass *p, Value &v)
void print(raw_ostream &OS) const override
print - Emit information about this stack frame to OS.
PassManagerPrettyStackEntry(Pass *p)
PassManagerPrettyStackEntry(Pass *p, Module &m)
Pass interface - Implemented by all 'passes'.
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
virtual bool doFinalization(Module &)
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
PrettyStackTraceEntry - This class is used to represent a frame of the "pretty" stack trace that is d...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
A BumpPtrAllocator that allows only elements of a specific type to be allocated.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
PassManagerType
Different types of internal pass managers.
@ PMT_FunctionPassManager
FPPassManager.
ArrayRef(const T &OneElt) -> ArrayRef< T >