Go to the documentation of this file.
16 #include "llvm/Config/llvm-config.h"
30 #ifdef EXPENSIVE_CHECKS
36 #define DEBUG_TYPE "ir"
51 const std::string &Banner)
const {
60 return "module (" +
M.getName().str() +
")";
69 return Resolver->getAnalysisIfAvailable(&AID) !=
nullptr;
85 return "Unnamed pass: implement Pass::getPassName()";
130 OS <<
"Pass::print not implemented for pass: '" <<
getPassName() <<
"'!\n";
133 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
140 #ifdef EXPENSIVE_CHECKS
141 uint64_t Pass::structuralHash(
Module &M)
const {
return StructuralHash(M); }
161 const std::string &Banner)
const {
170 return "function (" +
F.getName().str() +
")";
178 if (
F.hasOptNone()) {
180 <<
F.getName() <<
"\n");
208 const void *PassID,
bool isDefault)
245 GetCFGOnlyPasses(
VectorType &L) : CFGOnlyList(L) {}
247 void passEnumerate(
const PassInfo *
P)
override {
248 if (
P->isCFGOnlyPass())
249 CFGOnlyList.push_back(
P->getTypeInfo());
266 GetCFGOnlyPasses(Preserved).enumeratePasses();
278 pushUnique(Required,
ID);
283 pushUnique(Required, &
ID);
288 pushUnique(Required, &
ID);
289 pushUnique(RequiredTransitive, &
ID);
virtual void verifyAnalysis() const
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
const void * getTypeInfo() const
getTypeInfo - Return the id object for the pass...
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This is an optimization pass for GlobalISel generic memory operations.
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
ImmutablePass class - This class is used to provide information that does not need to be run.
AnalysisID getPassID() const
getPassID - Return the PassID number that corresponds to this pass.
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 enumerateWith(PassRegistrationListener *L)
enumerateWith - Enumerate the registered passes, calling the provided PassRegistrationListener's pass...
bool skipFunction(const Function &F) const
Optional passes call this function to check whether the pass should be skipped.
virtual bool isEnabled() const
isEnabled() should return true before calling shouldRunPass().
PassManagerType
Different types of internal pass managers.
static Pass * createPass(AnalysisID ID)
PassInfo class - An instance of this class exists for every pass known by the system,...
Pass * createPass() const
createPass() - Use this method to create an instance of this pass.
@ PMT_ModulePassManager
MPPassManager.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
virtual void * getAdjustedAnalysisPointer(AnalysisID ID)
getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through...
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
PMDataManager provides the common place to manage the analysis data used by pass managers.
virtual void preparePassManager(PMStack &)
Check if available pass managers are suitable for this pass or not.
AnalysisUsage & addRequiredTransitiveID(char &ID)
static const PassInfo * lookupPassInfo(const void *TI)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
StringRef getPassName() const
getPassName - Return the friendly name for the pass, never returns null
void enumeratePasses()
enumeratePasses - Iterate over the registered passes, calling the passEnumerate callback on each Pass...
PassManagerType getPotentialPassManagerType() const override
Return what kind of Pass Manager can manage this pass.
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
Represent the analysis usage information of a pass.
PassNameParser(cl::Option &O)
AnalysisResolver - Simple interface used by Pass objects to pull all analysis information out of pass...
This class implements an extremely fast bulk output stream that can only output to a stream.
virtual ImmutablePass * getAsImmutablePass()
Pass * createPrinterPass(raw_ostream &OS, const std::string &Banner) const override
createPrinterPass - Get a function printer pass.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
Base class of all SIMD vector types.
RegisterAGBase(StringRef Name, const void *InterfaceID, const void *PassID=nullptr, bool isDefault=false)
Pass * createPrinterPass(raw_ostream &OS, const std::string &Banner) const override
createPrinterPass - Get a module printer pass.
PassRegistrationListener class - This class is meant to be derived from by clients that are intereste...
bool skipModule(Module &M) const
Optional passes call this function to check whether the pass should be skipped.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A Module instance is used to store all the information related to an LLVM module.
bool mustPreserveAnalysisID(char &AID) const
mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable,...
static std::string getDescription(const Module &M)
virtual void releaseMemory()
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
void setPreservesCFG()
This function should be called by the pass, iff they do not:
StringRef - Represent a constant reference to a string, i.e.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
@ PMT_FunctionPassManager
FPPassManager.
http eax xorl edx cl sete al setne dl sall cl
SmallVectorImpl< AnalysisID > VectorType
PassManagerType getPotentialPassManagerType() const override
Return what kind of Pass Manager can manage this pass.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
void addRegistrationListener(PassRegistrationListener *L)
addRegistrationListener - Register the given PassRegistrationListener to receive passRegistered() cal...
virtual void initializePass()
initializePass - This method may be overriden by immutable passes to allow them to perform various in...
virtual PMDataManager * getAsPMDataManager()
PMStack - This class implements a stack data structure of PMDataManager pointers.
virtual void dumpPassStructure(unsigned Offset=0)
void setResolver(AnalysisResolver *AR)
virtual PassManagerType getPotentialPassManagerType() const
Return what kind of Pass Manager can manage this pass.
~PassNameParser() override
Pass interface - Implemented by all 'passes'.
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
~ImmutablePass() override
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
AnalysisUsage & addRequiredID(const void *ID)
const PassInfo * getPassInfo(const void *TI) const
getPassInfo - Look up a pass' corresponding PassInfo, indexed by the pass' type identifier (&MyPass::...
virtual bool shouldRunPass(const Pass *P, StringRef IRDescription)
IRDescription is a textual description of the IR unit the pass is running over.
void registerAnalysisGroup(const void *InterfaceID, const void *PassID, PassInfo &Registeree, bool isDefault, bool ShouldFree=false)
registerAnalysisGroup - Register an analysis group (or a pass implementing
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.
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.