13#ifndef LLVM_IR_LEGACYPASSMANAGERS_H
14#define LLVM_IR_LEGACYPASSMANAGERS_H
117 : P(p), V(nullptr), M(nullptr) {}
119 : P(p), V(&v), M(nullptr) {}
121 : P(p), V(nullptr), M(&m) {}
139 typedef std::vector<PMDataManager *>::const_reverse_iterator
iterator;
146 bool empty()
const {
return S.empty(); }
151 std::vector<PMDataManager *> S;
167 void initializeAllAnalysisInfo();
177 void schedulePass(
Pass *
P);
202 return ImmutablePasses;
212 IndirectPassManagers.push_back(Manager);
216 void dumpPasses()
const;
217 void dumpArguments()
const;
260 ID.AddInteger(Vec.size());
323 void add(
Pass *
P,
bool ProcessAnalysis =
true);
335 AvailableAnalysis.clear();
341 bool preserveHigherLevelAnalysis(
Pass *
P);
346 void collectRequiredAndUsedAnalyses(
354 void initializeAnalysisImpl(
Pass *
P);
365 void setDepth(
unsigned newDepth) { Depth = newDepth; }
369 void dumpPassArguments()
const;
372 void dumpRequiredSet(
const Pass *
P)
const;
373 void dumpPreservedSet(
const Pass *
P)
const;
374 void dumpUsedSet(
const Pass *
P)
const;
381 assert ( 0 &&
"Invalid use of getPassManagerType");
386 return &AvailableAnalysis;
399 unsigned initSizeRemarkInfo(
401 StringMap<std::pair<unsigned, unsigned>> &FunctionToInstrCount);
412 void emitInstrCountChangedRemark(
413 Pass *
P,
Module &M, int64_t Delta,
unsigned CountBefore,
414 StringMap<std::pair<unsigned, unsigned>> &FunctionToInstrCount,
465 bool runOnModule(
Module &M)
override;
477 bool doInitialization(
Module &M)
override;
486 bool doFinalization(
Module &M)
override;
493 Info.setPreservesAll();
497 void dumpPassStructure(
unsigned Offset)
override;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
static void cleanup(BlockFrequencyInfoImplBase &BFI)
Clear all memory not needed downstream.
Analysis containing CSE Info
This file defines the DenseMap class.
static bool runOnFunction(Function &F, bool PostInlining)
This file defines a hash set that can be used to remove duplication of nodes in a graph.
Loop::LoopBounds::Direction Direction
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
SmallVectorImpl< AnalysisID > VectorType
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),...
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.
PMDataManager * getAsPMDataManager() override
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.
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 removeDeadPasses(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove dead passes used by P.
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.
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()
void setTopLevelManager(PMTopLevelManager *T)
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.
unsigned getNumContainedPasses() const
virtual PassManagerType getPassManagerType() const
void add(Pass *P, bool ProcessAnalysis=true)
Add pass P into the PassVector.
DenseMap< AnalysisID, Pass * > * getAvailableAnalysis()
void populateInheritedAnalysis(PMStack &PMS)
void removeNotPreservedAnalysis(Pass *P)
Remove Analysis that is not preserved by the pass.
PMStack - This class implements a stack data structure of PMDataManager pointers.
std::vector< PMDataManager * >::const_reverse_iterator iterator
PMDataManager * top() const
LLVM_ABI void dump() const
LLVM_ABI void push(PMDataManager *PM)
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers.
void addIndirectPassManager(PMDataManager *Manager)
SmallVector< PMDataManager *, 8 > PassManagers
Collection of pass managers.
void addPassManager(PMDataManager *Manager)
unsigned getNumContainedManagers() const
SmallVectorImpl< ImmutablePass * > & getImmutablePasses()
PMTopLevelManager(PMDataManager *PMDM)
Initialize top level manager. Create first pass manager.
PassInfo class - An instance of this class exists for every pass known by the system,...
PassManagerPrettyStackEntry(Pass *p, Value &v)
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...
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.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
void fill(R &&Range, T &&Value)
Provide wrappers to std::fill which take ranges instead of having to pass begin/end explicitly.
FoldingSetBase::Node FoldingSetNode
PassManagerType
Different types of internal pass managers.
@ PMT_FunctionPassManager
FPPassManager.