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;
147 iterator
begin()
const {
return S.rbegin(); }
148 iterator
end()
const {
return S.rend(); }
153 bool empty()
const {
return S.empty(); }
158 std::vector<PMDataManager *> S;
171 return (
unsigned)PassManagers.size();
174 void initializeAllAnalysisInfo();
184 void schedulePass(
Pass *
P);
209 return ImmutablePasses;
213 PassManagers.push_back(Manager);
219 IndirectPassManagers.push_back(Manager);
223 void dumpPasses()
const;
224 void dumpArguments()
const;
306 initializeAnalysisInfo();
311 virtual Pass *getAsPass() = 0;
314 void recordAvailableAnalysis(
Pass *
P);
317 void verifyPreservedAnalysis(
Pass *P);
320 void removeNotPreservedAnalysis(
Pass *P);
332 void add(
Pass *P,
bool ProcessAnalysis =
true);
337 virtual void addLowerLevelRequiredPass(
Pass *P,
Pass *RequiredPass);
343 AvailableAnalysis.clear();
344 for (
unsigned i = 0; i <
PMT_Last; ++i)
345 InheritedAnalysis[i] =
nullptr;
350 bool preserveHigherLevelAnalysis(
Pass *P);
355 void collectRequiredAndUsedAnalyses(
363 void initializeAnalysisImpl(
Pass *P);
377 void dumpLastUses(
Pass *P,
unsigned Offset)
const;
378 void dumpPassArguments()
const;
381 void dumpRequiredSet(
const Pass *P)
const;
382 void dumpPreservedSet(
const Pass *P)
const;
383 void dumpUsedSet(
const Pass *P)
const;
386 return (
unsigned)PassVector.size();
390 assert ( 0 &&
"Invalid use of getPassManagerType");
395 return &AvailableAnalysis;
403 InheritedAnalysis[Index++] = (*I)->getAvailableAnalysis();
409 unsigned initSizeRemarkInfo(
411 StringMap<std::pair<unsigned, unsigned>> &FunctionToInstrCount);
422 void emitInstrCountChangedRemark(
423 Pass *P,
Module &M, int64_t Delta,
unsigned CountBefore,
424 StringMap<std::pair<unsigned, unsigned>> &FunctionToInstrCount,
441 bool isPassDebuggingExecutionsOrMore()
const;
476 bool runOnModule(
Module &M)
override;
488 bool doInitialization(
Module &M)
override;
497 bool doFinalization(
Module &M)
override;
508 void dumpPassStructure(
unsigned Offset)
override;
513 assert ( N < PassVector.size() &&
"Pass number out of range!");
Pass interface - Implemented by all 'passes'.
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.
PassManagerPrettyStackEntry(Pass *p, Value &v)
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
std::vector< PMDataManager * >::const_reverse_iterator iterator
PMDataManager * getAsPMDataManager() override
const VectorType & getUsedSet() const
static void cleanup(BlockFrequencyInfoImplBase &BFI)
Clear all memory not needed downstream.
const VectorType & getRequiredSet() const
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers...
void setDepth(unsigned newDepth)
void addPassManager(PMDataManager *Manager)
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 initializeAnalysisInfo()
Initialize available analysis information.
void AddInteger(signed I)
const VectorType & getPreservedSet() const
void populateInheritedAnalysis(PMStack &PMS)
FPPassManager manages BBPassManagers and FunctionPasses.
PMStack - This class implements a stack data structure of PMDataManager pointers. ...
PassManagerPrettyStackEntry - This is used to print informative information about what pass is runnin...
PassManagerPrettyStackEntry(Pass *p, Module &m)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
unsigned getNumContainedManagers() const
Analysis containing CSE Info
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
static bool runOnFunction(Function &F, bool PostInlining)
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
void print(raw_ostream &OS) const override
print - Emit information about this stack frame to OS.
void addIndirectPassManager(PMDataManager *Manager)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
virtual PassManagerType getPassManagerType() const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
SmallVectorImpl< ImmutablePass * > & getImmutablePasses()
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...
print lazy value Lazy Value Info Printer Pass
ImmutablePass class - This class is used to provide information that does not need to be run...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
SmallVector< Pass *, 16 > PassVector
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.
const VectorType & getRequiredTransitiveSet() const
void setTopLevelManager(PMTopLevelManager *T)
SmallVector< PMDataManager *, 8 > PassManagers
Collection of pass managers.
Node - This class is used to maintain the singly linked bucket list in a folding set.
FunctionPass * getContainedPass(unsigned N)
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
PMDataManager provides the common place to manage the analysis data used by pass managers.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
PMDataManager * top() const
LLVM Value Representation.
unsigned getNumContainedPasses() const
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.
unsigned getDepth() const
bool getPreservesAll() const
Determine whether a pass said it does not transform its input at all.
PassManagerType getPassManagerType() const override