13 #ifndef LLVM_IR_LEGACYPASSMANAGERS_H 14 #define LLVM_IR_LEGACYPASSMANAGERS_H 89 template <
typename T>
class ArrayRef;
118 : P(p), V(nullptr), M(nullptr) {}
120 : P(p), V(&v), M(nullptr) {}
122 : P(p), V(nullptr), M(&m) {}
140 typedef std::vector<PMDataManager *>::const_reverse_iterator
iterator;
141 iterator
begin()
const {
return S.rbegin(); }
142 iterator
end()
const {
return S.rend(); }
147 bool empty()
const {
return S.empty(); }
152 std::vector<PMDataManager *> S;
165 return (
unsigned)PassManagers.size();
168 void initializeAllAnalysisInfo();
178 void schedulePass(
Pass *
P);
203 return ImmutablePasses;
207 PassManagers.push_back(Manager);
213 IndirectPassManagers.push_back(Manager);
217 void dumpPasses()
const;
218 void dumpArguments()
const;
300 initializeAnalysisInfo();
305 virtual Pass *getAsPass() = 0;
308 void recordAvailableAnalysis(
Pass *
P);
311 void verifyPreservedAnalysis(
Pass *P);
314 void removeNotPreservedAnalysis(
Pass *P);
326 void add(
Pass *P,
bool ProcessAnalysis =
true);
331 virtual void addLowerLevelRequiredPass(
Pass *P,
Pass *RequiredPass);
337 AvailableAnalysis.clear();
338 for (
unsigned i = 0; i <
PMT_Last; ++i)
339 InheritedAnalysis[i] =
nullptr;
344 bool preserveHigherLevelAnalysis(
Pass *P);
349 void collectRequiredAndUsedAnalyses(
357 void initializeAnalysisImpl(
Pass *P);
371 void dumpLastUses(
Pass *P,
unsigned Offset)
const;
372 void dumpPassArguments()
const;
375 void dumpRequiredSet(
const Pass *P)
const;
376 void dumpPreservedSet(
const Pass *P)
const;
377 void dumpUsedSet(
const Pass *P)
const;
380 return (
unsigned)PassVector.size();
384 assert ( 0 &&
"Invalid use of getPassManagerType");
389 return &AvailableAnalysis;
397 InheritedAnalysis[Index++] = (*I)->getAvailableAnalysis();
403 unsigned initSizeRemarkInfo(
405 StringMap<std::pair<unsigned, unsigned>> &FunctionToInstrCount);
416 void emitInstrCountChangedRemark(
417 Pass *P,
Module &M, int64_t Delta,
unsigned CountBefore,
418 StringMap<std::pair<unsigned, unsigned>> &FunctionToInstrCount,
435 bool isPassDebuggingExecutionsOrMore()
const;
470 bool runOnModule(
Module &M)
override;
482 bool doInitialization(
Module &M)
override;
491 bool doFinalization(
Module &M)
override;
502 void dumpPassStructure(
unsigned Offset)
override;
507 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...
static uint64_t add(uint64_t LeftOp, uint64_t RightOp)
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.
Loop::LoopBounds::Direction Direction
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