17 #include "llvm/Config/llvm-config.h" 36 #define DEBUG_TYPE "ir" 51 const std::string &Banner)
const {
64 return Resolver->getAnalysisIfAvailable(&AID,
true) !=
nullptr;
80 return "Unnamed pass: implement Pass::getPassName()";
125 OS <<
"Pass::print not implemented for pass: '" <<
getPassName() <<
"'!\n";
128 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 150 const std::string &Banner)
const {
175 const std::string &Banner)
const {
199 <<
"' on function " << F->
getName() <<
"\n");
231 const void *PassID,
bool isDefault)
268 GetCFGOnlyPasses(
VectorType &L) : CFGOnlyList(L) {}
289 GetCFGOnlyPasses(Preserved).enumeratePasses();
311 RequiredTransitive.push_back(&ID);
Pass interface - Implemented by all 'passes'.
const PassInfo * getPassInfo(const void *TI) const
getPassInfo - Look up a pass' corresponding PassInfo, indexed by the pass' type identifier (&MyPass::...
void registerAnalysisGroup(const void *InterfaceID, const void *PassID, PassInfo &Registeree, bool isDefault, bool ShouldFree=false)
registerAnalysisGroup - Register an analysis group (or a pass implementing
PassManagerType
Different types of internal pass managers.
void enumeratePasses()
enumeratePasses - Iterate over the registered passes, calling the passEnumerate callback on each Pass...
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
PassNameParser(cl::Option &O)
void enumerateWith(PassRegistrationListener *L)
enumerateWith - Enumerate the registered passes, calling the provided PassRegistrationListener's pass...
This class represents lattice values for constants.
virtual PMDataManager * getAsPMDataManager()
virtual void dumpPassStructure(unsigned Offset=0)
A Module instance is used to store all the information related to an LLVM module. ...
virtual void releaseMemory()
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
SmallVectorImpl< AnalysisID > VectorType
FunctionPass * createPrintFunctionPass(raw_ostream &OS, const std::string &Banner="")
Create and return a pass that prints functions to the specified raw_ostream as they are processed...
virtual bool doInitialization(Function &)
doInitialization - Virtual method overridden by BasicBlockPass subclasses to do any necessary per-fun...
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
Pass * createPrinterPass(raw_ostream &OS, const std::string &Banner) const override
createPrinterPass - Get a function printer pass.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
RegisterAGBase(StringRef Name, const void *InterfaceID, const void *PassID=nullptr, bool isDefault=false)
virtual void preparePassManager(PMStack &)
Check if available pass managers are suitable for this pass or not.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
bool mustPreserveAnalysisID(char &AID) const
mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID.
PassManagerType getPotentialPassManagerType() const override
Return what kind of Pass Manager can manage this pass.
virtual void initializePass()
initializePass - This method may be overriden by immutable passes to allow them to perform various in...
void setResolver(AnalysisResolver *AR)
~PassNameParser() override
virtual void verifyAnalysis() const
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
AnalysisResolver - Simple interface used by Pass objects to pull all analysis information out of pass...
virtual bool shouldRunPass(const Pass *P, const Module &U)
amdgpu Simplify well known AMD library false Value Value const Twine & Name
virtual PassManagerType getPotentialPassManagerType() const
Return what kind of Pass Manager can manage this pass.
LLVMContext & getContext() const
Get the global data context.
This file contains the simple types necessary to represent the attributes associated with functions a...
bool skipBasicBlock(const BasicBlock &BB) const
Optional passes call this function to check whether the pass should be skipped.
PMStack - This class implements a stack data structure of PMDataManager pointers. ...
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time...
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
const void * getTypeInfo() const
getTypeInfo - Return the id object for the pass...
virtual bool doFinalization(Function &)
doFinalization - Virtual method overriden by BasicBlockPass subclasses to do any post processing need...
virtual ImmutablePass * getAsImmutablePass()
static const PassInfo * lookupPassInfo(const void *TI)
const BasicBlock & getEntryBlock() const
LLVM Basic Block Representation.
AnalysisID getPassID() const
getPassID - Return the PassID number that corresponds to this pass.
Pass * createPrinterPass(raw_ostream &OS, const std::string &Banner) const override
createPrinterPass - Get a module printer pass.
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
PassManagerType getPotentialPassManagerType() const override
Return what kind of Pass Manager can manage this pass.
void addRegistrationListener(PassRegistrationListener *L)
addRegistrationListener - Register the given PassRegistrationListener to receive passRegistered() cal...
Represent the analysis usage information of a pass.
void passEnumerate(const PassInfo *P) override
passEnumerate - Callback function invoked when someone calls enumeratePasses on this PassRegistration...
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
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.
ImmutablePass class - This class is used to provide information that does not need to be run...
AnalysisUsage & addRequiredID(const void *ID)
Module.h This file contains the declarations for the Module class.
BasicBlockPass * createPrintBasicBlockPass(raw_ostream &OS, const std::string &Banner="")
Create and return a pass that writes the BB to the specified raw_ostream.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
This file declares the interface for bisecting optimizations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Class to represent vector types.
Pass * createPass() const
createPass() - Use this method to create an instance of this pass.
amdgpu Simplify well known AMD library false Value Value * Arg
StringRef getName() const
Return a constant reference to the value's name.
StringRef getPassName() const
getPassName - Return the friendly name for the pass, never returns null
const Function * getParent() const
Return the enclosing method, or null if none.
bool skipModule(Module &M) const
Optional passes call this function to check whether the pass should be skipped.
PassRegistrationListener class - This class is meant to be derived from by clients that are intereste...
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
~ImmutablePass() override
AnalysisUsage & addRequiredTransitiveID(char &ID)
bool isCFGOnlyPass() const
isCFGOnlyPass - return true if this pass only looks at the CFG for the function.
PMDataManager provides the common place to manage the analysis data used by pass managers.
ModulePass * createPrintModulePass(raw_ostream &OS, const std::string &Banner="", bool ShouldPreserveUseListOrder=false)
Create and return a pass that writes the module to the specified raw_ostream.
This file defines passes to print out IR in various granularities.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static Pass * createPass(AnalysisID ID)
virtual void * getAdjustedAnalysisPointer(AnalysisID ID)
getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through...
This class implements an extremely fast bulk output stream that can only output to a stream...
Pass * createPrinterPass(raw_ostream &OS, const std::string &Banner) const override
createPrinterPass - Get a basic block printer pass.
StringRef - Represent a constant reference to a string, i.e.
PassManagerType getPotentialPassManagerType() const override
Return what kind of Pass Manager can manage this pass.
bool skipFunction(const Function &F) const
Optional passes call this function to check whether the pass should be skipped.