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;
164 return (
unsigned)PassManagers.size();
167 void initializeAllAnalysisInfo();
177 void schedulePass(
Pass *
P);
202 return ImmutablePasses;
206 PassManagers.push_back(Manager);
212 IndirectPassManagers.push_back(Manager);
216 void dumpPasses()
const;
217 void dumpArguments()
const;
260 ID.AddInteger(Vec.size());
305 void recordAvailableAnalysis(
Pass *
P);
308 void verifyPreservedAnalysis(
Pass *
P);
311 void removeNotPreservedAnalysis(
Pass *
P);
323 void add(
Pass *
P,
bool ProcessAnalysis =
true);
328 virtual void addLowerLevelRequiredPass(
Pass *
P,
Pass *RequiredPass);
330 virtual std::tuple<Pass *, bool> getOnTheFlyPass(
Pass *
P,
AnalysisID PI,
335 AvailableAnalysis.clear();
341 bool preserveHigherLevelAnalysis(
Pass *
P);
346 void collectRequiredAndUsedAnalyses(
354 void initializeAnalysisImpl(
Pass *
P);
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;
377 return (
unsigned)PassVector.size();
381 assert ( 0 &&
"Invalid use of getPassManagerType");
386 return &AvailableAnalysis;
393 InheritedAnalysis[
Index++] = PMDM->getAvailableAnalysis();
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,
431 bool isPassDebuggingExecutionsOrMore()
const;
465 bool runOnModule(
Module &M)
override;
473 using ModulePass::doInitialization;
477 bool doInitialization(
Module &M)
override;
482 using ModulePass::doFinalization;
486 bool doFinalization(
Module &M)
override;
493 Info.setPreservesAll();
497 void dumpPassStructure(
unsigned Offset)
override;
502 assert (
N < PassVector.size() &&
"Pass number out of range!");
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
Machine Check Debug Module
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.
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
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.
virtual Pass * getAsPass()=0
void setDepth(unsigned newDepth)
unsigned getDepth() const
SmallVector< Pass *, 16 > PassVector
PMTopLevelManager * getTopLevelManager()
void setTopLevelManager(PMTopLevelManager *T)
void initializeAnalysisInfo()
Initialize available analysis information.
unsigned getNumContainedPasses() const
virtual PassManagerType getPassManagerType() const
DenseMap< AnalysisID, Pass * > * getAvailableAnalysis()
void populateInheritedAnalysis(PMStack &PMS)
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()
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)
PassManagerPrettyStackEntry(Pass *p)
PassManagerPrettyStackEntry(Pass *p, Module &m)
Pass interface - Implemented by 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.
void fill(R &&Range, T &&Value)
Provide wrappers to std::fill which take ranges instead of having to pass begin/end explicitly.
PassManagerType
Different types of internal pass managers.
@ PMT_FunctionPassManager
FPPassManager.
ArrayRef(const T &OneElt) -> ArrayRef< T >