Go to the source code of this file.
|
| STATISTIC (NumTermFold, "Number of terminating condition fold recognized and performed") |
|
static std::optional< std::tuple< PHINode *, PHINode *, const SCEV *, bool > > | canFoldTermCondOfLoop (Loop *L, ScalarEvolution &SE, DominatorTree &DT, const LoopInfo &LI, const TargetTransformInfo &TTI) |
|
static bool | RunTermFold (Loop *L, ScalarEvolution &SE, DominatorTree &DT, LoopInfo &LI, const TargetTransformInfo &TTI, TargetLibraryInfo &TLI, MemorySSA *MSSA) |
|
| INITIALIZE_PASS_BEGIN (LoopTermFold, "loop-term-fold", "Loop Terminator Folding", false, false) INITIALIZE_PASS_END(LoopTermFold |
|
◆ DEBUG_TYPE
#define DEBUG_TYPE "loop-term-fold" |
◆ canFoldTermCondOfLoop()
Definition at line 52 of file LoopTermFold.cpp.
References llvm::dbgs(), DL, llvm::ScalarEvolution::getBackedgeTakenCount(), llvm::BranchInst::getCondition(), llvm::getLoopEstimatedTripCount(), llvm::User::getOperand(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::SCEVAddRecExpr::getPostIncExpr(), llvm::ScalarEvolution::getSCEV(), llvm::ScalarEvolution::getSmallConstantMaxTripCount(), llvm::SCEVAddRecExpr::getStepRecurrence(), llvm::BasicBlock::getTerminator(), llvm::ScalarEvolution::hasLoopInvariantBackedgeTakenCount(), llvm::SCEVNAryExpr::hasNoSelfWrap(), llvm::Instruction::hasPoisonGeneratingFlags(), llvm::SCEVAddRecExpr::isAffine(), llvm::isAlmostDeadIV(), llvm::SCEVExpander::isHighCostExpansion(), llvm::ScalarEvolution::isKnownNonZero(), llvm::SCEVExpander::isSafeToExpand(), llvm::ScalarEvolution::isSCEVable(), llvm::BranchInst::isUnconditional(), LHS, LLVM_DEBUG, llvm::matchSimpleRecurrence(), llvm::mustExecuteUBIfPoisonOnPathTo(), PostInc, RHS, and llvm::SCEVCheapExpansionBudget.
Referenced by RunTermFold().
◆ INITIALIZE_PASS_BEGIN()
INITIALIZE_PASS_BEGIN |
( |
LoopTermFold |
, |
|
|
"loop-term-fold" |
, |
|
|
"Loop Terminator Folding" |
, |
|
|
false |
, |
|
|
false |
|
|
) |
| |
◆ RunTermFold()
Definition at line 230 of file LoopTermFold.cpp.
References assert(), canFoldTermCondOfLoop(), llvm::SCEVExpander::clear(), llvm::IRBuilderBase::CreateICmp(), llvm::dbgs(), llvm::DeleteDeadPHIs(), DL, llvm::Instruction::eraseFromParent(), llvm::SCEVExpander::expandCodeFor(), llvm::BranchInst::getCondition(), llvm::BranchInst::getSuccessor(), llvm::BasicBlock::getTerminator(), llvm::CmpInst::ICMP_EQ, llvm::SCEVExpander::isSafeToExpand(), LLVM_DEBUG, llvm::BranchInst::setCondition(), and llvm::BranchInst::swapSuccessors().
Referenced by llvm::LoopTermFoldPass::run().
◆ STATISTIC()
STATISTIC |
( |
NumTermFold |
, |
|
|
"Number of terminating condition fold recognized and performed" |
|
|
) |
| |
◆ false
loop term Loop Terminator false |
◆ fold
◆ Folding
loop term Loop Terminator Folding |