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();
77 CurrentRegion = RQ.back();
78 skipThisRegion =
false;
79 redoThisRegion =
false;
103 skipThisRegion ?
"<deleted>" :
108 if (!skipThisRegion) {
148 RQ.push_back(CurrentRegion);
162 <<
" after all region Pass:\n";
170 errs().
indent(Offset*2) <<
"Region Pass Manager\n";
197 for (
const auto *BB : R->
blocks()) {
201 Out <<
"Printing <null> Block";
225 while (!PMS.
empty() &&
242 while (!PMS.
empty() &&
253 assert (!PMS.
empty() &&
"Unable to create Region Pass Manager");
277 const std::string &Banner)
const {
278 return new PrintRegionPass(Banner, O);
295 <<
"' on function " << F.
getName() <<
"\n");
Pass interface - Implemented by all 'passes'.
bool preserveHigherLevelAnalysis(Pass *P)
PassManagerType
Different types of internal pass managers.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
This class represents lattice values for constants.
bool hasOptNone() const
Do not optimize this function (-O0).
virtual void dumpPassStructure(unsigned Offset=0)
void dumpLastUses(Pass *P, unsigned Offset) const
Pass * createPrinterPass(raw_ostream &O, const std::string &Banner) const override
Get a pass to print the LLVM IR in the region.
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
bool skipRegion(Region &R) const
Optional passes call this function to check whether the pass should be skipped.
void dumpPassInfo(Pass *P, enum PassDebuggingString S1, enum PassDebuggingString S2, StringRef Msg)
The pass manager to schedule RegionPasses.
virtual bool shouldRunPass(const Pass *P, StringRef IRDescription)
IRDescription is a textual description of the IR unit the pass is running over.
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers...
Timer * getPassTimer(Pass *)
Request the timer for this legacy-pass-manager's pass instance.
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)
void verifyPreservedAnalysis(Pass *P)
verifyPreservedAnalysis – Verify analysis presreved by pass P.
void populateInheritedAnalysis(PMStack &PMS)
This header defines classes/functions to handle pass execution timing information with interfaces for...
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...
virtual bool isEnabled() const
isEnabled should return true before calling shouldRunPass
PassManagerPrettyStackEntry - This is used to print informative information about what pass is runnin...
RegionT * getTopLevelRegion() const
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time...
bool isPassDebuggingExecutionsOrMore() const
isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions or higher is specified...
block_range blocks()
Returns a range view of the basic blocks in the region.
void add(Pass *P, bool ProcessAnalysis=true)
Add pass P into the PassVector.
virtual bool doFinalization()
Analysis containing CSE Info
const BasicBlock & getEntryBlock() const
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.
static void addRegionIntoQueue(Region &R, std::deque< Region *> &RQ)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static std::string getDescription(const Region &R)
A pass that runs on each Region in a function.
void addIndirectPassManager(PMDataManager *Manager)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
virtual PassManagerType getPassManagerType() const
Represent the analysis usage information of a pass.
bool runOnFunction(Function &F) override
Execute all of the passes scheduled for execution.
FunctionPass class - This class is used to implement most global optimizations.
Pass * getContainedPass(unsigned N)
Get passes contained by this manager.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
void recordAvailableAnalysis(Pass *P)
Augment AvailableAnalysis by adding analysis made available by pass P.
BlockT * getEntry() const
Get the entry BasicBlock of the Region.
void dumpRequiredSet(const Pass *P) const
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.
This file declares the interface for bisecting optimizations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void setPreservesAll()
Set by analyses that do not transform their input at all.
std::string getNameStr() const
Returns the name of the Region.
void verifyRegion() const
Verify if the region is a correct region.
StringRef getName() const
Return a constant reference to the value's name.
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())
PMDataManager * top() const
void clearNodeCache()
Clear the Node Cache for all Regions.
unsigned getNumContainedPasses() const
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.
void dumpPreservedSet(const Pass *P) const
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.