39 #define DEBUG_TYPE "loop-simplifycfg" 48 for (
auto &Block : Blocks) {
51 BasicBlock *Succ = cast_or_null<BasicBlock>(Block);
79 class LoopSimplifyCFGLegacyPass :
public LoopPass {
82 LoopSimplifyCFGLegacyPass() :
LoopPass(ID) {
90 DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
91 LoopInfo &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
92 ScalarEvolution &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE();
105 "Simplify loop CFG",
false,
false)
111 return new LoopSimplifyCFGLegacyPass();
Pass interface - Implemented by all 'passes'.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
bool MergeBlockIntoPredecessor(BasicBlock *BB, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr, MemoryDependenceResults *MemDep=nullptr, DeferredDominance *DDT=nullptr)
Attempts to merge a block into its predecessor, if possible.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
PreservedAnalyses getLoopPassPreservedAnalyses()
Returns the minimum set of Analyses that all loop passes must preserve.
Compute iterated dominance frontiers using a linear time algorithm.
This header provides classes for managing a pipeline of passes over loops in LLVM IR...
This is the interface for a simple mod/ref and alias analysis over globals.
Legacy pass manager pass to access dependence information.
The main scalar evolution driver.
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...
#define INITIALIZE_PASS_DEPENDENCY(depName)
This is the interface for a SCEV-based alias analysis.
LoopT * getLoopFor(const BlockT *BB) const
Return the inner most loop that BB lives in.
const BasicBlock * getSingleSuccessor() const
Return the successor of this block if it has a single successor.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
A set of analyses that are preserved following a run of a transformation pass.
const BasicBlock * getSinglePredecessor() const
Return the predecessor of this block if it has a single predecessor block.
LLVM Basic Block Representation.
Represent the analysis usage information of a pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Pass * createLoopSimplifyCFGPass()
void initializeLoopSimplifyCFGLegacyPassPass(PassRegistry &)
void forgetLoop(const Loop *L)
This method should be called by the client when it has changed a loop in a way that may effect Scalar...
INITIALIZE_PASS_BEGIN(LoopSimplifyCFGLegacyPass, "loop-simplifycfg", "Simplify loop CFG", false, false) INITIALIZE_PASS_END(LoopSimplifyCFGLegacyPass
Represents a single loop in the control flow graph.
void getLoopAnalysisUsage(AnalysisUsage &AU)
Helper to consistently add the set of standard passes to a loop pass's AnalysisUsage.
static bool simplifyLoopCFG(Loop &L, DominatorTree &DT, LoopInfo &LI, ScalarEvolution &SE)
PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U)
This is the interface for LLVM's primary stateless and local alias analysis.
A container for analyses that lazily runs them and caches their results.
iterator_range< block_iterator > blocks() const