24 #define DEBUG_TYPE "regionpassmgr"
34 skipThisRegion =
false;
35 redoThisRegion =
false;
37 CurrentRegion =
nullptr;
43 for (
const auto &
E : R)
56 RI = &getAnalysis<RegionInfoPass>().getRegionInfo();
78 CurrentRegion = RQ.back();
79 skipThisRegion =
false;
80 redoThisRegion =
false;
104 skipThisRegion ?
"<deleted>" :
109 if (!skipThisRegion) {
149 RQ.push_back(CurrentRegion);
163 dbgs() <<
"\nRegion tree of function " << F.
getName()
164 <<
" after all region Pass:\n";
174 errs().
indent(Offset*2) <<
"Region Pass Manager\n";
201 for (
const auto *BB : R->
blocks()) {
205 Out <<
"Printing <null> Block";
211 StringRef getPassName()
const override {
return "Print Region IR"; }
229 while (!PMS.
empty() &&
246 while (!PMS.
empty() &&
257 assert (!PMS.
empty() &&
"Unable to create Region Pass Manager");
281 const std::string &Banner)
const {
282 return new PrintRegionPass(Banner, O);
294 <<
"' on function " << F.
getName() <<
"\n");
Pass interface - Implemented by all 'passes'.
bool preserveHigherLevelAnalysis(Pass *P)
PassManagerType
Different types of internal pass managers.
bool shouldRunPass(const Pass *P, const UnitT &U)
Checks the bisect limit to determine if the specified pass should run.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
std::string getNameStr() const
Returns the name of the Region.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
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
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
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()
bool skipRegion(Region &R) const
Optional passes call this function to check whether the pass should be skipped.
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.
const BasicBlock & getEntryBlock() const
This file declares the interface for bisecting optimizations.
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.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
OptBisect & getOptBisect()
Access the object which manages optimization bisection for failure analysis.
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.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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...
StringRef - Represent a constant reference to a string, i.e.
void getAnalysisUsage(AnalysisUsage &Info) const override
Pass Manager itself does not invalidate any analysis info.