Lines Matching refs:Loop
1 //===- LoopInfo.cpp - Natural Loop Calculator -----------------------------===//
44 template class llvm::LoopBase<BasicBlock, Loop>;
45 template class llvm::LoopInfoBase<BasicBlock, Loop>;
58 // Loop implementation
61 bool Loop::isLoopInvariant(const Value *V) const {
67 bool Loop::hasLoopInvariantOperands(const Instruction *I) const {
71 bool Loop::makeLoopInvariant(Value *V, bool &Changed, Instruction *InsertPt,
79 bool Loop::makeLoopInvariant(Instruction *I, bool &Changed,
125 bool Loop::getIncomingAndBackEdge(BasicBlock *&Incoming,
132 assert(PI != pred_end(H) && "Loop must have at least one backedge!");
151 PHINode *Loop::getCanonicalInductionVariable() const {
158 // Loop over all of the PHI nodes, looking for a canonical indvar.
175 ICmpInst *Loop::getLatchCmpInst() const {
185 static Value *findFinalIVValue(const Loop &L, const PHINode &IndVar,
202 std::optional<Loop::LoopBounds>
203 Loop::LoopBounds::getBounds(const Loop &L, PHINode &IndVar,
231 using Direction = Loop::LoopBounds::Direction;
233 ICmpInst::Predicate Loop::LoopBounds::getCanonicalPredicate() const {
275 Direction Loop::LoopBounds::getDirection() const {
288 std::optional<Loop::LoopBounds> Loop::getBounds(ScalarEvolution &SE) const {
295 PHINode *Loop::getInductionVariable(ScalarEvolution &SE) const {
334 bool Loop::getInductionDescriptor(ScalarEvolution &SE,
342 bool Loop::isAuxiliaryInductionVariable(PHINode &AuxIndVar,
368 BranchInst *Loop::getLoopGuardBranch() const {
376 // Loop should be in rotate form.
412 bool Loop::isCanonical(ScalarEvolution &SE) const {
432 static bool isBlockInLCSSAForm(const Loop &L, const BasicBlock &BB,
463 bool Loop::isLCSSAForm(const DominatorTree &DT, bool IgnoreTokens) const {
470 bool Loop::isRecursivelyLCSSAForm(const DominatorTree &DT, const LoopInfo &LI,
480 bool Loop::isLoopSimplifyForm() const {
487 bool Loop::isSafeToClone() const {
502 MDNode *Loop::getLoopID() const {
526 void Loop::setLoopID(MDNode *LoopID) const {
528 "Loop ID needs at least one operand");
530 "Loop ID should refer to itself");
538 void Loop::setLoopAlreadyUnrolled() {
549 void Loop::setLoopMustProgress() {
565 bool Loop::isAnnotatedParallel() const {
632 DebugLoc Loop::getStartLoc() const { return getLocRange().getStart(); }
634 Loop::LocRange Loop::getLocRange() const {
667 std::string Loop::getLocStr() const {
679 LLVM_DUMP_METHOD void Loop::dump() const { print(dbgs()); }
681 LLVM_DUMP_METHOD void Loop::dumpVerbose() const {
694 Loop &Unloop;
703 DenseMap<Loop *, Loop *> SubloopParents;
710 UnloopUpdater(Loop *UL, LoopInfo *LInfo) : Unloop(*UL), LI(LInfo), DFS(UL) {}
719 Loop *getNearestLoop(BasicBlock *BB, Loop *BBLoop);
732 Loop *L = LI->getLoopFor(POI);
733 Loop *NL = getNearestLoop(POI, L);
761 Loop *L = LI->getLoopFor(*POI);
762 Loop *NL = getNearestLoop(*POI, L);
778 Loop *OuterParent = LI->getLoopFor(BB);
786 for (Loop *OldParent = Unloop.getParentLoop(); OldParent != OuterParent;
797 Loop *Subloop = *std::prev(Unloop.end());
801 if (Loop *Parent = SubloopParents[Subloop])
813 Loop *UnloopUpdater::getNearestLoop(BasicBlock *BB, Loop *BBLoop) {
817 Loop *NearLoop = BBLoop;
819 Loop *Subloop = nullptr;
839 Loop *L = LI->getLoopFor(Succ);
887 void LoopInfo::erase(Loop *Unloop) {
888 assert(!Unloop->isInvalid() && "Loop has already been erased!");
933 Loop *ParentLoop = Unloop->getParentLoop();
934 for (Loop::iterator I = ParentLoop->begin();; ++I) {
953 const Loop *L = getLoopFor(I->getParent());
984 OS << "Loop info for function '" << F.getName() << "':\n";
989 void llvm::printLoop(Loop &L, raw_ostream &OS, const std::string &Banner) {
1008 OS << "\n; Loop:";
1051 // Loop property not found.
1055 MDNode *llvm::findOptionMDForLoop(const Loop *TheLoop, StringRef Name) {
1065 llvm::findStringMetadataForLoop(const Loop *TheLoop, StringRef Name) {
1079 std::optional<bool> llvm::getOptionalBoolLoopAttribute(const Loop *TheLoop,
1097 bool llvm::getBooleanLoopAttribute(const Loop *TheLoop, StringRef Name) {
1101 std::optional<int> llvm::getOptionalIntLoopAttribute(const Loop *TheLoop,
1115 int llvm::getIntLoopAttribute(const Loop *TheLoop, StringRef Name,
1120 CallBase *llvm::getLoopConvergenceHeart(const Loop *TheLoop) {
1140 bool llvm::isFinite(const Loop *L) {
1146 bool llvm::hasMustProgress(const Loop *L) {
1150 bool llvm::isMustProgress(const Loop *L) {
1206 INITIALIZE_PASS_BEGIN(LoopInfoWrapperPass, "loops", "Natural Loop Information",
1209 INITIALIZE_PASS_END(LoopInfoWrapperPass, "loops", "Natural Loop Information",