Go to the documentation of this file.
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";
166 errs().
indent(Offset*2) <<
"Region Pass Manager\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"; }
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();
289 if (
F.hasOptNone()) {
291 if (R.getEntry() == &
F.getEntryBlock())
293 <<
"' on function " <<
F.getName() <<
"\n");
void recordAvailableAnalysis(Pass *P)
Augment AvailableAnalysis by adding analysis made available by pass P.
void getAnalysisUsage(AnalysisUsage &Info) const override
Pass Manager itself does not invalidate any analysis info.
This is an optimization pass for GlobalISel generic memory operations.
bool skipRegion(Region &R) const
Optional passes call this function to check whether the pass should be skipped.
RegionT * getTopLevelRegion() const
void assignPassManager(PMStack &PMS, PassManagerType PMT=PMT_RegionPassManager) override
Assign pass manager to manage this pass.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
void schedulePass(Pass *P)
Schedule pass P for execution.
void dumpPassInfo(Pass *P, enum PassDebuggingString S1, enum PassDebuggingString S2, StringRef Msg)
virtual bool isEnabled() const
isEnabled() should return true before calling shouldRunPass().
PassManagerType
Different types of internal pass managers.
void push(PMDataManager *PM)
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
PassManagerPrettyStackEntry - This is used to print informative information about what pass is runnin...
void dumpPassStructure(unsigned Offset) override
Print passes managed by this manager.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
PMDataManager provides the common place to manage the analysis data used by pass managers.
void dumpLastUses(Pass *P, unsigned Offset) const
unsigned getNumContainedPasses() const
The TimeRegion class is used as a helper class to call the startTimer() and stopTimer() methods of th...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
void dumpPreservedSet(const Pass *P) const
Represent the analysis usage information of a pass.
void initializeAnalysisImpl(Pass *P)
All Required analyses should be available to the pass as it runs! Here we fill in the AnalysisImpls m...
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void verifyRegion() const
Verify if the region is a correct region.
This class implements an extremely fast bulk output stream that can only output to a stream.
void clearNodeCache()
Clear the Node Cache for all Regions.
Analysis containing CSE Info
PMDataManager * top() const
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
void preparePassManager(PMStack &PMS) override
Check if available pass managers are suitable for this pass or not.
PMTopLevelManager * getTopLevelManager()
BlockT * getEntry() const
Get the entry BasicBlock of the Region.
Timer * getPassTimer(Pass *)
Request the timer for this legacy-pass-manager's pass instance.
void removeDeadPasses(Pass *P, StringRef Msg, enum PassDebuggingString)
Remove dead passes used by P.
bool isFunctionInPrintList(StringRef FunctionName)
bool preserveHigherLevelAnalysis(Pass *P)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void dumpRequiredSet(const Pass *P) const
The pass manager to schedule RegionPasses.
A pass that runs on each Region in a function.
static void addRegionIntoQueue(Region &R, std::deque< Region * > &RQ)
StringRef - Represent a constant reference to a string, i.e.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
virtual PassManagerType getPassManagerType() const
void verifyPreservedAnalysis(Pass *P)
verifyPreservedAnalysis – Verify analysis presreved by pass P.
void removeNotPreservedAnalysis(Pass *P)
Remove Analysis that is not preserved by the pass.
PMStack - This class implements a stack data structure of PMDataManager pointers.
Pass * createPrinterPass(raw_ostream &O, const std::string &Banner) const override
Get a pass to print the LLVM IR in the region.
void setPreservesAll()
Set by analyses that do not transform their input at all.
void add(Pass *P, bool ProcessAnalysis=true)
Add pass P into the PassVector.
std::string getNameStr() const
Returns the name of the Region.
@ PMT_RegionPassManager
RGPassManager.
void addIndirectPassManager(PMDataManager *Manager)
Pass interface - Implemented by all 'passes'.
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers.
FunctionPass class - This class is used to implement most global optimizations.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
static std::string getDescription(const Region &R)
bool runOnFunction(Function &F) override
Execute all of the passes scheduled for execution.
bool isPassDebuggingExecutionsOrMore() const
isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions or higher is specified.
void populateInheritedAnalysis(PMStack &PMS)
virtual bool shouldRunPass(const Pass *P, StringRef IRDescription)
IRDescription is a textual description of the IR unit the pass is running over.
Pass * getContainedPass(unsigned N)
Get passes contained by this manager.