27#define DEBUG_TYPE "regionpassmgr"
37 CurrentRegion =
nullptr;
43 for (
const auto &E : R)
50 Info.setPreservesAll();
56 RI = &getAnalysis<RegionInfoPass>().getRegionInfo();
71 Changed |= RP->doInitialization(R, *
this);
78 CurrentRegion = RQ.back();
92 bool LocalChanged =
false;
97#ifdef EXPENSIVE_CHECKS
100 LocalChanged =
P->runOnRegion(CurrentRegion, *
this);
102#ifdef EXPENSIVE_CHECKS
103 if (!LocalChanged && (RefHash !=
P->structuralHash(
F))) {
104 llvm::errs() <<
"Pass modifies its input and doesn't report it: "
105 <<
P->getPassName() <<
"\n";
110 Changed |= LocalChanged;
153 Changed |=
P->doFinalization();
158 <<
" after all region Pass:\n";
169 P->dumpPassStructure(
Offset + 1);
195 for (
const auto *BB :
R->blocks()) {
199 Out <<
"Printing <null> Block";
205 StringRef getPassName()
const override {
return "Print Region IR"; }
208char PrintRegionPass::ID = 0;
223 while (!PMS.
empty() &&
240 while (!PMS.
empty() &&
251 assert (!PMS.
empty() &&
"Unable to create Region Pass Manager");
275 const std::string &Banner)
const {
276 return new PrintRegionPass(Banner, O);
284 Function &
F = *R.getEntry()->getParent();
290 if (
F.hasOptNone()) {
292 if (R.getEntry() == &
F.getEntryBlock())
294 <<
"' on function " <<
F.getName() <<
"\n");
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Analysis containing CSE Info
static std::string getDescription(const CallGraphSCC &SCC)
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This file declares the interface for bisecting optimizations.
This header defines classes/functions to handle pass execution timing information with interfaces for...
static void addRegionIntoQueue(Region &R, std::deque< Region * > &RQ)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
FunctionPass class - This class is used to implement most global optimizations.
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
virtual bool isEnabled() const
isEnabled() should return true before calling shouldRunPass().
virtual bool shouldRunPass(const StringRef PassName, StringRef IRDescription)
IRDescription is a textual description of the IR unit the pass is running over.
PMDataManager provides the common place to manage the analysis data used by pass managers.
void removeDeadPasses(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove dead passes used by P.
void dumpLastUses(Pass *P, unsigned Offset) const
void recordAvailableAnalysis(Pass *P)
Augment AvailableAnalysis by adding analysis made available by pass P.
bool isPassDebuggingExecutionsOrMore() const
isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions or higher is specified.
PMTopLevelManager * getTopLevelManager()
void dumpRequiredSet(const Pass *P) const
void initializeAnalysisImpl(Pass *P)
All Required analyses should be available to the pass as it runs! Here we fill in the AnalysisImpls m...
void verifyPreservedAnalysis(Pass *P)
verifyPreservedAnalysis – Verify analysis presreved by pass P.
bool preserveHigherLevelAnalysis(Pass *P)
unsigned getNumContainedPasses() const
virtual PassManagerType getPassManagerType() const
void add(Pass *P, bool ProcessAnalysis=true)
Add pass P into the PassVector.
void populateInheritedAnalysis(PMStack &PMS)
void dumpPreservedSet(const Pass *P) const
void removeNotPreservedAnalysis(Pass *P)
Remove Analysis that is not preserved by the pass.
void dumpPassInfo(Pass *P, enum PassDebuggingString S1, enum PassDebuggingString S2, StringRef Msg)
PMStack - This class implements a stack data structure of PMDataManager pointers.
PMDataManager * top() const
void push(PMDataManager *PM)
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers.
void addIndirectPassManager(PMDataManager *Manager)
void schedulePass(Pass *P)
Schedule pass P for execution.
PassManagerPrettyStackEntry - This is used to print informative information about what pass is runnin...
Pass interface - Implemented by all 'passes'.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
The pass manager to schedule RegionPasses.
void dumpPassStructure(unsigned Offset) override
Print passes managed by this manager.
Pass * getContainedPass(unsigned N)
Get passes contained by this manager.
void getAnalysisUsage(AnalysisUsage &Info) const override
Pass Manager itself does not invalidate any analysis info.
bool runOnFunction(Function &F) override
Execute all of the passes scheduled for execution.
std::string getNameStr() const
Returns the name of the Region.
void verifyRegion() const
Verify if the region is a correct region.
BlockT * getEntry() const
Get the entry BasicBlock of the Region.
void clearNodeCache()
Clear the Node Cache for all Regions.
RegionT * getTopLevelRegion() const
A pass that runs on each Region in a function.
void preparePassManager(PMStack &PMS) override
Check if available pass managers are suitable for this pass or not.
bool skipRegion(Region &R) const
Optional passes call this function to check whether the pass should be skipped.
void assignPassManager(PMStack &PMS, PassManagerType PMT=PMT_RegionPassManager) override
Assign pass manager to manage this pass.
Pass * createPrinterPass(raw_ostream &O, const std::string &Banner) const override
Get a pass to print the LLVM IR in the region.
StringRef - Represent a constant reference to a string, i.e.
The TimeRegion class is used as a helper class to call the startTimer() and stopTimer() methods of th...
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
PassManagerType
Different types of internal pass managers.
@ PMT_RegionPassManager
RGPassManager.
Timer * getPassTimer(Pass *)
Request the timer for this legacy-pass-manager's pass instance.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool isFunctionInPrintList(StringRef FunctionName)
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.