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

Go to the source code of this file.

Macros
#define DEBUG_TYPE "loop-bound-split"
Functions
static void analyzeICmp (ScalarEvolution &SE, ICmpInst *ICmp, ConditionInfo &Cond, const Loop &L)
static bool calculateUpperBound (const Loop &L, ScalarEvolution &SE, ConditionInfo &Cond, bool IsExitCond)
static bool hasProcessableCondition (const Loop &L, ScalarEvolution &SE, ICmpInst *ICmp, ConditionInfo &Cond, bool IsExitCond)
static bool isProcessableCondBI (const ScalarEvolution &SE, const BranchInst *BI)
static bool canSplitLoopBound (const Loop &L, const DominatorTree &DT, ScalarEvolution &SE, ConditionInfo &Cond)
static bool isProfitableToTransform (const Loop &L, const BranchInst *BI)
static BranchInst * findSplitCandidate (const Loop &L, ScalarEvolution &SE, ConditionInfo &ExitingCond, ConditionInfo &SplitCandidateCond)
static bool splitLoopBound (Loop &L, DominatorTree &DT, LoopInfo &LI, ScalarEvolution &SE, LPMUpdater &U)

DEBUG_TYPE

#define DEBUG_TYPE "loop-bound-split"

analyzeICmp()

Definition at line 50 of file LoopBoundSplit.cpp.

References llvm::cast(), Cond, llvm::dyn_cast(), llvm::PHINode::getIncomingValueForBlock(), llvm::ScalarEvolution::getSCEV(), llvm::CmpInst::getSwappedPredicate(), llvm::isa(), llvm::PatternMatch::m_ICmp(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and std::swap().

Referenced by hasProcessableCondition().

calculateUpperBound()

Definition at line 79 of file LoopBoundSplit.cpp.

References llvm::BitWidth, Cond, llvm::dyn_cast(), llvm::ScalarEvolution::getAddExpr(), llvm::ScalarEvolution::getConstant(), llvm::ScalarEvolution::getExitCount(), llvm::APInt::getMaxValue(), llvm::ScalarEvolution::getOne(), llvm::APInt::getSignedMaxValue(), llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm::isa(), llvm::ScalarEvolution::isKnownPredicate(), and llvm::CmpInst::isSigned().

Referenced by hasProcessableCondition().

canSplitLoopBound()

findSplitCandidate()

hasProcessableCondition()

isProcessableCondBI()

isProfitableToTransform()

splitLoopBound()

Definition at line 286 of file LoopBoundSplit.cpp.

References llvm::PHINode::addIncoming(), llvm::BasicBlock::begin(), canSplitLoopBound(), llvm::cast(), llvm::DominatorTreeBase< NodeT, IsPostDom >::changeImmediateDominator(), llvm::cloneLoopWithPreheader(), Cond, llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::SCEVExpander::expandCodeFor(), findSplitCandidate(), llvm::ScalarEvolution::forgetLoop(), llvm::BasicBlock::front(), llvm::BasicBlock::getContext(), llvm::LoopBase< BlockT, LoopT >::getExitBlock(), llvm::LoopBase< BlockT, LoopT >::getExitingBlock(), llvm::ConstantInt::getFalse(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::ScalarEvolution::getSCEV(), llvm::ScalarEvolution::getSMinExpr(), llvm::BranchInst::getSuccessor(), llvm::BasicBlock::getTerminator(), llvm::ConstantInt::getTrue(), llvm::SCEV::getType(), llvm::ScalarEvolution::getUMinExpr(), llvm::CmpInst::ICMP_NE, isProfitableToTransform(), llvm::ScalarEvolution::isSCEVable(), llvm::CmpInst::isSigned(), llvm::BasicBlock::phis(), llvm::remapInstructionsInBlocks(), llvm::seq(), llvm::BranchInst::setCondition(), llvm::Instruction::setDebugLoc(), llvm::PHINode::setIncomingValueForBlock(), llvm::Value::setName(), llvm::User::setOperand(), llvm::BranchInst::setSuccessor(), llvm::simplifyLoop(), and llvm::SplitEdge().

Referenced by llvm::LoopBoundSplitPass::run().