LLVM: lib/Transforms/Scalar/LoopSimplifyCFG.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "loop-simplifycfg"
Functions
STATISTIC (NumTerminatorsFolded, "Number of terminators folded to unconditional branches")
STATISTIC (NumLoopBlocksDeleted, "Number of loop blocks deleted")
STATISTIC (NumLoopExitsDeleted, "Number of loop exiting edges deleted")
static BasicBlock * getOnlyLiveSuccessor (BasicBlock *BB)
If BB is a switch or a conditional branch, but only one of its successors can be reached from this block in runtime, return this successor.
static void removeBlockFromLoops (BasicBlock *BB, Loop *FirstLoop, Loop *LastLoop=nullptr)
Removes BB from all loops from [FirstLoop, LastLoop) in parent chain.
static Loop * getInnermostLoopFor (SmallPtrSetImpl< BasicBlock * > &BBs, Loop &L, LoopInfo &LI)
Find innermost loop that contains at least one block from BBs and contains the header of loop L.
static bool constantFoldTerminators (Loop &L, DominatorTree &DT, LoopInfo &LI, ScalarEvolution &SE, MemorySSAUpdater *MSSAU, bool &IsLoopDeleted)
Turn branches and switches with known constant conditions into unconditional branches.
static bool mergeBlocksIntoPredecessors (Loop &L, DominatorTree &DT, LoopInfo &LI, MemorySSAUpdater *MSSAU, ScalarEvolution &SE)
static bool simplifyLoopCFG (Loop &L, DominatorTree &DT, LoopInfo &LI, ScalarEvolution &SE, MemorySSAUpdater *MSSAU, bool &IsLoopDeleted)

DEBUG_TYPE

#define DEBUG_TYPE "loop-simplifycfg"

constantFoldTerminators()

getInnermostLoopFor()

getOnlyLiveSuccessor()

mergeBlocksIntoPredecessors()

Definition at line 692 of file LoopSimplifyCFG.cpp.

References llvm::Block, llvm::cast_or_null(), Changed, llvm::ScalarEvolution::forgetBlockAndLoopDispositions(), llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor(), llvm::MemorySSAUpdater::getMemorySSA(), llvm::BasicBlock::getSinglePredecessor(), llvm::MergeBlockIntoPredecessor(), llvm::VerifyMemorySSA, and llvm::MemorySSA::verifyMemorySSA().

Referenced by llvm::VPlanTransforms::createAndOptimizeReplicateRegions(), llvm::VPlanTransforms::optimize(), and simplifyLoopCFG().

removeBlockFromLoops()

void removeBlockFromLoops ( BasicBlock * BB, Loop * FirstLoop, Loop * LastLoop = nullptr ) static

simplifyLoopCFG()

STATISTIC() [1/3]

STATISTIC ( NumLoopBlocksDeleted ,
"Number of loop blocks deleted" )

STATISTIC() [2/3]

STATISTIC ( NumLoopExitsDeleted ,
"Number of loop exiting edges deleted" )

STATISTIC() [3/3]

STATISTIC ( NumTerminatorsFolded ,
"Number of terminators folded to unconditional branches" )

EnableTermFolding