13#include "llvm/Config/llvm-config.h"
19#define DEBUG_TYPE "machine-region-info"
23STATISTIC(numMachineRegions,
"The # of machine regions");
24STATISTIC(numMachineSimpleRegions,
"The # of simple machine regions");
56 ++numMachineSimpleRegions;
69 TopLevelRegion =
new MachineRegion(Entry,
nullptr,
this, DT,
nullptr);
87 auto DT = &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
89 &getAnalysis<MachinePostDominatorTreeWrapperPass>().getPostDomTree();
90 auto DF = &getAnalysis<MachineDominanceFrontier>();
123#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
133 "Detect single entry single exit regions",
true,
true)
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
FunctionPass class - This class is used to implement most global optimizations.
Analysis pass which computes a MachineDominatorTree.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
MachinePostDominatorTree - an analysis pass wrapper for DominatorTree used to compute the post-domina...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
~MachineRegionInfoPass() override
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
void print(raw_ostream &OS, const Module *) const override
print - Print out the internal state of the pass.
~MachineRegionInfo() override
void recalculate(MachineFunction &F, MachineDominatorTree *DT, MachinePostDominatorTree *PDT, MachineDominanceFrontier *DF)
void updateStatistics(MachineRegion *R) final
MachineRegion(MachineBasicBlock *Entry, MachineBasicBlock *Exit, MachineRegionInfo *RI, MachineDominatorTree *DT, MachineRegion *Parent=nullptr)
A Module instance is used to store all the information related to an LLVM module.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A single entry single exit Region.
Analysis that detects all canonical Regions.
static bool VerifyRegionInfo
void print(raw_ostream &OS) const
void verifyAnalysis() const
A RegionNode represents a subregion or a BasicBlock that is part of a Region.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
char & MachineRegionInfoPassID
MachineRegionInfo - This pass computes SESE regions for machine functions.
FunctionPass * createMachineRegionInfoPass()
void initializeMachineRegionInfoPassPass(PassRegistry &)