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 <<
" after all region Pass:\n";
171 errs().
indent(Offset*2) <<
"Region Pass Manager\n";
198 for (
const auto *BB : R->
blocks()) {
202 Out <<
"Printing <null> Block";
226 while (!PMS.
empty() &&
243 while (!PMS.
empty() &&
254 assert (!PMS.
empty() &&
"Unable to create Region Pass Manager");
278 const std::string &Banner)
const {
279 return new PrintRegionPass(Banner, O);
291 <<
"' 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.
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.
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.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
void dumpPassInfo(Pass *P, enum PassDebuggingString S1, enum PassDebuggingString S2, StringRef Msg)
The pass manager to schedule RegionPasses.
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...
virtual bool shouldRunPass(const Pass *P, const Module &U)
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...
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")
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.