Lines Matching refs:CurLoop
151 Loop *CurLoop = nullptr; member in __anon04ee8af90111::LoopIdiomRecognize
360 CurLoop = L; in runOnLoop()
387 const SCEV *BECount = SE->getBackedgeTakenCount(CurLoop); in runOnCountableLoop()
399 CurLoop->getUniqueExitBlocks(ExitBlocks); in runOnCountableLoop()
402 << CurLoop->getHeader()->getParent()->getName() in runOnCountableLoop()
403 << "] Countable Loop %" << CurLoop->getHeader()->getName() in runOnCountableLoop()
409 SafetyInfo.computeLoopSafetyInfo(CurLoop); in runOnCountableLoop()
416 for (auto *BB : CurLoop->getBlocks()) { in runOnCountableLoop()
418 if (LI->getLoopFor(BB) != CurLoop) in runOnCountableLoop()
509 if (!StoreEv || StoreEv->getLoop() != CurLoop || !StoreEv->isAffine()) in isLegalStore()
532 CurLoop->isLoopInvariant(SplatValue)) { in isLegalStore()
568 if (!LoadEv || LoadEv->getLoop() != CurLoop || !LoadEv->isAffine()) in isLegalStore()
847 if (!StoreEv || StoreEv->getLoop() != CurLoop || !StoreEv->isAffine()) in processLoopMemCpy()
850 if (!LoadEv || LoadEv->getLoop() != CurLoop || !LoadEv->isAffine()) in processLoopMemCpy()
912 if (!Ev || Ev->getLoop() != CurLoop || !Ev->isAffine()) in processLoopMemSet()
933 if (!SplatValue || !CurLoop->isLoopInvariant(SplatValue)) in processLoopMemSet()
998 unsigned StoreSize, Loop *CurLoop, in getNumBytes() argument
1010 CurLoop, ICmpInst::ICMP_NE, BECount, in getNumBytes()
1048 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in processLoopStridedStore()
1084 if (mayLoopAccessLocation(BasePtr, ModRefInfo::ModRef, CurLoop, BECount, in processLoopStridedStore()
1094 getNumBytes(BECount, IntIdxTy, StoreSize, CurLoop, DL, SE); in processLoopStridedStore()
1204 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in processLoopStoreOfLoopLoad()
1247 mayLoopAccessLocation(StoreBasePtr, ModRefInfo::ModRef, CurLoop, BECount, in processLoopStoreOfLoopLoad()
1256 if (mayLoopAccessLocation(StoreBasePtr, ModRefInfo::ModRef, CurLoop, in processLoopStoreOfLoopLoad()
1287 if (mayLoopAccessLocation(LoadBasePtr, ModRefInfo::Mod, CurLoop, BECount, in processLoopStoreOfLoopLoad()
1321 getNumBytes(BECount, IntIdxTy, StoreSize, CurLoop, DL, SE); in processLoopStoreOfLoopLoad()
1406 if (ApplyCodeSizeHeuristics && CurLoop->getNumBlocks() > 1) { in avoidLIRForMultiBlockLoop()
1407 if (CurLoop->isOutermost() && (!IsMemset || !IsLoopMemset)) { in avoidLIRForMultiBlockLoop()
1408 LLVM_DEBUG(dbgs() << " " << CurLoop->getHeader()->getParent()->getName() in avoidLIRForMultiBlockLoop()
1420 << CurLoop->getHeader()->getParent()->getName() in runOnNoncountableLoop()
1422 << CurLoop->getHeader()->getName() << "\n"); in runOnNoncountableLoop()
1495 static bool detectPopcountIdiom(Loop *CurLoop, BasicBlock *PreCondBB, in detectPopcountIdiom() argument
1508 LoopEntry = *(CurLoop->block_begin()); in detectPopcountIdiom()
1591 Value *T = matchCondition(PreCondBr, CurLoop->getLoopPreheader()); in detectPopcountIdiom()
1630 static bool detectShiftUntilZeroIdiom(Loop *CurLoop, const DataLayout &DL, in detectShiftUntilZeroIdiom() argument
1640 LoopEntry = *(CurLoop->block_begin()); in detectShiftUntilZeroIdiom()
1664 InitX = PhiX->getIncomingValueForBlock(CurLoop->getLoopPreheader()); in detectShiftUntilZeroIdiom()
1708 if (CurLoop->getNumBackEdges() != 1 || CurLoop->getNumBlocks() != 1) in recognizeAndInsertFFS()
1720 if (!detectShiftUntilZeroIdiom(CurLoop, *DL, IntrinID, InitX, in recognizeAndInsertFFS()
1726 if (!CurLoop->contains(cast<Instruction>(U))) { in recognizeAndInsertFFS()
1732 if (!CurLoop->contains(cast<Instruction>(U))) { in recognizeAndInsertFFS()
1747 BasicBlock *PH = CurLoop->getLoopPreheader(); in recognizeAndInsertFFS()
1780 auto InstWithoutDebugIt = CurLoop->getHeader()->instructionsWithoutDebug(); in recognizeAndInsertFFS()
1811 if (CurLoop->getNumBackEdges() != 1 || CurLoop->getNumBlocks() != 1) in recognizePopcount()
1814 BasicBlock *LoopBody = *(CurLoop->block_begin()); in recognizePopcount()
1821 BasicBlock *PH = CurLoop->getLoopPreheader(); in recognizePopcount()
1840 if (!detectPopcountIdiom(CurLoop, PreCondBB, CntInst, CntPhi, Val)) in recognizePopcount()
1965 BasicBlock *Body = *(CurLoop->block_begin()); in transformLoopToCountable()
1993 SE->forgetLoop(CurLoop); in transformLoopToCountable()
1999 BasicBlock *PreHead = CurLoop->getLoopPreheader(); in transformLoopToPopcount()
2069 BasicBlock *Body = *(CurLoop->block_begin()); in transformLoopToPopcount()
2099 SE->forgetLoop(CurLoop); in transformLoopToPopcount()
2143 static bool detectShiftUntilBitTestIdiom(Loop *CurLoop, Value *&BaseX, in detectShiftUntilBitTestIdiom() argument
2150 if (CurLoop->getNumBlocks() != 1 || CurLoop->getNumBackEdges() != 1) { in detectShiftUntilBitTestIdiom()
2155 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in detectShiftUntilBitTestIdiom()
2156 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in detectShiftUntilBitTestIdiom()
2182 CurLoop)))); in detectShiftUntilBitTestIdiom()
2215 assert(CurLoop->isLoopInvariant(BaseX) && in detectShiftUntilBitTestIdiom()
2301 if (!detectShiftUntilBitTestIdiom(CurLoop, X, BitMask, BitPos, XCurr, in recognizeShiftUntilBitTest()
2312 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in recognizeShiftUntilBitTest()
2313 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in recognizeShiftUntilBitTest()
2316 BasicBlock *SuccessorBB = CurLoop->getExitBlock(); in recognizeShiftUntilBitTest()
2369 BitPos, XMaskedLeadingOnePos, CurLoop->getName() + ".backedgetakencount", in recognizeShiftUntilBitTest()
2375 CurLoop->getName() + ".tripcount", /*HasNUW=*/true, in recognizeShiftUntilBitTest()
2419 auto *IV = Builder.CreatePHI(Ty, 2, CurLoop->getName() + ".iv"); in recognizeShiftUntilBitTest()
2430 CurLoop->getName() + ".ivcheck"); in recognizeShiftUntilBitTest()
2441 SE->forgetLoop(CurLoop); in recognizeShiftUntilBitTest()
2479 static bool detectShiftUntilZeroIdiom(Loop *CurLoop, ScalarEvolution *SE, in detectShiftUntilZeroIdiom() argument
2489 if (CurLoop->getNumBlocks() != 1 || CurLoop->getNumBackEdges() != 1) { in detectShiftUntilZeroIdiom()
2497 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in detectShiftUntilZeroIdiom()
2498 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in detectShiftUntilZeroIdiom()
2519 if (!match(ValShifted, m_Shift(m_LoopInvariant(m_Value(Val), CurLoop), in detectShiftUntilZeroIdiom()
2530 m_LoopInvariant(m_Value(ExtraOffset), CurLoop))) && in detectShiftUntilZeroIdiom()
2535 m_LoopInvariant(m_Value(ExtraOffset), CurLoop))) && in detectShiftUntilZeroIdiom()
2584 !isMustProgress(CurLoop) && !SE->isKnownNonNegative(SE->getSCEV(Val))) { in detectShiftUntilZeroIdiom()
2656 if (!detectShiftUntilZeroIdiom(CurLoop, SE, ValShiftedIsZero, IntrID, IV, in recognizeShiftUntilZero()
2667 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in recognizeShiftUntilZero()
2668 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in recognizeShiftUntilZero()
2671 BasicBlock *SuccessorBB = CurLoop->getExitBlock(); in recognizeShiftUntilZero()
2724 IVFinal, Start, CurLoop->getName() + ".backedgetakencount", in recognizeShiftUntilZero()
2731 CurLoop->getName() + ".tripcount", /*HasNUW=*/true, in recognizeShiftUntilZero()
2743 auto *CIV = Builder.CreatePHI(Ty, 2, CurLoop->getName() + ".iv"); in recognizeShiftUntilZero()
2753 CurLoop->getName() + ".ivcheck"); in recognizeShiftUntilZero()
2777 SE->forgetLoop(CurLoop); in recognizeShiftUntilZero()