Go to the documentation of this file.
13 #ifndef LLVM_IR_LEGACYPASSMANAGERS_H
14 #define LLVM_IR_LEGACYPASSMANAGERS_H
89 template <
typename T>
class ArrayRef;
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();
void addImmutablePass(ImmutablePass *P)
Add immutable pass and initialize it.
void recordAvailableAnalysis(Pass *P)
Augment AvailableAnalysis by adding analysis made available by pass P.
const VectorType & getRequiredTransitiveSet() const
This is an optimization pass for GlobalISel generic memory operations.
bool runOnFunction(Function &F)
run - Execute all of the passes scheduled for execution.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
void print(raw_ostream &OS) const override
print - Emit information about this stack frame to OS.
AnalysisUsage * findAnalysisUsage(Pass *P)
Find analysis usage information for the pass P.
ImmutablePass class - This class is used to provide information that does not need to be run.
SmallVector< PMDataManager *, 8 > PassManagers
Collection of pass managers.
PassManagerPrettyStackEntry(Pass *p)
Pass * getAsPass() override
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
void schedulePass(Pass *P)
Schedule pass P for execution.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
void dumpPassInfo(Pass *P, enum PassDebuggingString S1, enum PassDebuggingString S2, StringRef Msg)
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
unsigned getNumContainedManagers() const
PassManagerType
Different types of internal pass managers.
PassInfo class - An instance of this class exists for every pass known by the system,...
const PassInfo * findAnalysisPassInfo(AnalysisID AID) const
Retrieve the PassInfo for an analysis.
void push(PMDataManager *PM)
PassManagerPrettyStackEntry - This is used to print informative information about what pass is runnin...
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.
the resulting code requires compare and branches when and if * p
bool doInitialization(Module &M) override
doInitialization - Run all of the initializers for the function passes.
PrettyStackTraceEntry - This class is used to represent a frame of the "pretty" stack trace that is d...
PMDataManager provides the common place to manage the analysis data used by pass managers.
void dumpLastUses(Pass *P, unsigned Offset) const
bool getPreservesAll() const
Determine whether a pass said it does not transform its input at all.
unsigned getNumContainedPasses() const
std::vector< PMDataManager * >::const_reverse_iterator iterator
PassManagerType getPassManagerType() const override
PMDataManager * getAsPMDataManager() override
SmallVectorImpl< ImmutablePass * > & getImmutablePasses()
void collectLastUses(SmallVectorImpl< Pass * > &LastUses, Pass *P)
Collect passes whose last user is P.
const VectorType & getUsedSet() const
void dumpPreservedSet(const Pass *P) const
Represent the analysis usage information of a pass.
void initializeAnalysisImpl(Pass *P)
All Required analyses should be available to the pass as it runs! Here we fill in the AnalysisImpls m...
void setDepth(unsigned newDepth)
This class implements an extremely fast bulk output stream that can only output to a stream.
void cleanup()
cleanup - After running all passes, clean up pass manager cache.
void dumpArguments() const
void dumpPassArguments() const
Analysis containing CSE Info
FunctionPass * getContainedPass(unsigned N)
PMDataManager * top() const
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
bool doFinalization(Module &M) override
doFinalization - Run all of the finalizers for the function passes.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
const VectorType & getRequiredSet() const
PassManagerPrettyStackEntry(Pass *p, Value &v)
void initializeAnalysisInfo()
Initialize available analysis information.
PMTopLevelManager * getTopLevelManager()
void getAnalysisUsage(AnalysisUsage &Info) const override
Pass Manager itself does not invalidate any analysis info.
void addPassManager(PMDataManager *Manager)
void removeDeadPasses(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove dead passes used by P.
bool preserveHigherLevelAnalysis(Pass *P)
DenseMap< AnalysisID, Pass * > * InheritedAnalysis[PMT_Last]
PMTopLevelManager(PMDataManager *PMDM)
Initialize top level manager. Create first pass manager.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void dumpRequiredSet(const Pass *P) const
A Module instance is used to store all the information related to an LLVM module.
void dumpPassStructure(unsigned Offset) override
Print passes managed by this manager.
void setTopLevelManager(PMTopLevelManager *T)
void dumpUsedSet(const Pass *P) const
virtual bool doFinalization(Module &)
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
StringRef - Represent a constant reference to a string, i.e.
@ PMT_FunctionPassManager
FPPassManager.
Node - This class is used to maintain the singly linked bucket list in a folding set.
PassManagerPrettyStackEntry(Pass *p, Module &m)
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Machine Check Debug Module
virtual PassManagerType getPassManagerType() const
const CustomOperand< const MCSubtargetInfo & > Msg[]
void verifyPreservedAnalysis(Pass *P)
verifyPreservedAnalysis – Verify analysis presreved by pass P.
void removeNotPreservedAnalysis(Pass *P)
Remove Analysis that is not preserved by the pass.
FPPassManager manages BBPassManagers and FunctionPasses.
virtual Pass * getAsPass()=0
virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass)
Add RequiredPass into list of lower level passes required by pass P.
PMStack - This class implements a stack data structure of PMDataManager pointers.
void add(Pass *P, bool ProcessAnalysis=true)
Add pass P into the PassVector.
virtual std::tuple< Pass *, bool > getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F)
SmallVector< Pass *, 16 > PassVector
Loop::LoopBounds::Direction Direction
DenseMap< AnalysisID, Pass * > * getAvailableAnalysis()
void initializeAllAnalysisInfo()
void addIndirectPassManager(PMDataManager *Manager)
bool runOnModule(Module &M) override
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
unsigned getDepth() const
void setLastUser(ArrayRef< Pass * > AnalysisPasses, Pass *P)
Set pass P as the last user of the given analysis passes.
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.
Pass interface - Implemented by all 'passes'.
void freePass(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove P.
const VectorType & getPreservedSet() const
virtual ~PMTopLevelManager()
Destructor.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers.
FunctionPass class - This class is used to implement most global optimizations.
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.
Pass * findAnalysisPass(AnalysisID AID)
Find the pass that implements Analysis AID.
bool isPassDebuggingExecutionsOrMore() const
isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions or higher is specified.
void populateInheritedAnalysis(PMStack &PMS)
LLVM Value Representation.
Pass * findAnalysisPass(AnalysisID AID, bool Direction)
Find the pass that implements Analysis AID.