23 #define DEBUG_TYPE "regionpassmgr"
33 skipThisRegion =
false;
34 redoThisRegion =
false;
36 CurrentRegion =
nullptr;
42 for (
const auto &E : R)
55 RI = &getAnalysis<RegionInfoPass>().getRegionInfo();
67 for (std::deque<Region *>::const_iterator
I = RQ.begin(), E = RQ.end();
79 CurrentRegion = RQ.back();
80 skipThisRegion =
false;
81 redoThisRegion =
false;
105 skipThisRegion ?
"<deleted>" :
110 if (!skipThisRegion) {
150 RQ.push_back(CurrentRegion);
164 dbgs() <<
"\nRegion tree of function " << F.
getName()
165 <<
" after all region Pass:\n";
175 errs().
indent(Offset*2) <<
"Region Pass Manager\n";
193 PrintRegionPass(
const std::string &B,
raw_ostream &o)
202 for (
const auto *BB : R->
blocks()) {
206 Out <<
"Printing <null> Block";
228 while (!PMS.
empty() &&
245 while (!PMS.
empty() &&
256 assert (!PMS.
empty() &&
"Unable to create Region Pass Manager");
280 const std::string &Banner)
const {
281 return new PrintRegionPass(Banner, O);
Pass interface - Implemented by all 'passes'.
bool preserveHigherLevelAnalysis(Pass *P)
PassManagerType
Different types of internal pass managers.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
std::string getNameStr() const
Returns the name of the Region.
void dumpLastUses(Pass *P, unsigned Offset) const
virtual void dumpPassStructure(unsigned Offset=0)
Pass * createPrinterPass(raw_ostream &O, const std::string &Banner) const override
Get a pass to print the LLVM IR in the region.
static void addRegionIntoQueue(Region &R, std::deque< Region * > &RQ)
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
void dumpRequiredSet(const Pass *P) const
RegionT * getTopLevelRegion() const
void dumpPassInfo(Pass *P, enum PassDebuggingString S1, enum PassDebuggingString S2, StringRef Msg)
The pass manager to schedule RegionPasses.
virtual PassManagerType getPassManagerType() const
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers...
Timer * getPassTimer(Pass *)
If TimingInfo is enabled then start pass timer.
StringRef getName() const
Return a constant reference to the value's name.
The TimeRegion class is used as a helper class to call the startTimer() and stopTimer() methods of th...
void schedulePass(Pass *P)
Schedule pass P for execution.
AnalysisUsage & addRequired()
void freePass(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove P.
virtual bool doInitialization(Region *R, RGPassManager &RGM)
bool isPassDebuggingExecutionsOrMore() const
isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions or higher is specified...
void verifyPreservedAnalysis(Pass *P)
verifyPreservedAnalysis – Verify analysis presreved by pass P.
void populateInheritedAnalysis(PMStack &PMS)
block_range blocks()
Returns a range view of the basic blocks in the region.
PMStack - This class implements a stack data structure of PMDataManager pointers. ...
void initializeAnalysisImpl(Pass *P)
All Required analyses should be available to the pass as it runs! Here we fill in the AnalysisImpls m...
PassManagerPrettyStackEntry - This is used to print informative information about what pass is runnin...
void add(Pass *P, bool ProcessAnalysis=true)
Add pass P into the PassVector.
unsigned getNumContainedPasses() const
virtual bool doFinalization()
void dumpPassStructure(unsigned Offset) override
Print passes managed by this manager.
void assignPassManager(PMStack &PMS, PassManagerType PMT=PMT_RegionPassManager) override
Assign pass manager to manage this pass.
void preparePassManager(PMStack &PMS) override
Check if available pass managers are suitable for this pass or not.
void dumpPreservedSet(const Pass *P) const
A pass that runs on each Region in a function.
void addIndirectPassManager(PMDataManager *Manager)
Represent the analysis usage information of a pass.
bool runOnFunction(Function &F) override
Execute all of the passes scheduled for execution.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
FunctionPass class - This class is used to implement most global optimizations.
Pass * getContainedPass(unsigned N)
Get passes contained by this manager.
void recordAvailableAnalysis(Pass *P)
Augment AvailableAnalysis by adding analysis made available by pass P.
void removeNotPreservedAnalysis(Pass *P)
Remove Analysis that is not preserved by the pass.
void removeDeadPasses(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove dead passes used by P.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
PMDataManager * top() const
void setPreservesAll()
Set by analyses that do not transform their input at all.
void verifyRegion() const
Verify if the region is a correct region.
virtual bool runOnRegion(Region *R, RGPassManager &RGM)=0
Run the pass on a specific Region.
void push(PMDataManager *PM)
PMDataManager provides the common place to manage the analysis data used by pass managers.
void clearNodeCache()
Clear the Node Cache for all Regions.
BlockT * getEntry() const
Get the entry BasicBlock of the Region.
This class implements an extremely fast bulk output stream that can only output to a stream...
void getAnalysisUsage(AnalysisUsage &Info) const override
Pass Manager itself does not invalidate any analysis info.