Lines Matching refs:CurLoop

141   Loop *CurLoop = nullptr;  member in __anon066a00fb0111::LoopIdiomRecognize
286 CurLoop = L; in runOnLoop()
313 const SCEV *BECount = SE->getBackedgeTakenCount(CurLoop); in runOnCountableLoop()
325 CurLoop->getUniqueExitBlocks(ExitBlocks); in runOnCountableLoop()
328 << CurLoop->getHeader()->getParent()->getName() in runOnCountableLoop()
329 << "] Countable Loop %" << CurLoop->getHeader()->getName() in runOnCountableLoop()
335 SafetyInfo.computeLoopSafetyInfo(CurLoop); in runOnCountableLoop()
342 for (auto *BB : CurLoop->getBlocks()) { in runOnCountableLoop()
344 if (LI->getLoopFor(BB) != CurLoop) in runOnCountableLoop()
435 if (!StoreEv || StoreEv->getLoop() != CurLoop || !StoreEv->isAffine()) in isLegalStore()
458 CurLoop->isLoopInvariant(SplatValue)) { in isLegalStore()
494 if (!LoadEv || LoadEv->getLoop() != CurLoop || !LoadEv->isAffine()) in isLegalStore()
772 if (!StoreEv || StoreEv->getLoop() != CurLoop || !StoreEv->isAffine()) in processLoopMemCpy()
775 if (!LoadEv || LoadEv->getLoop() != CurLoop || !LoadEv->isAffine()) in processLoopMemCpy()
838 if (!Ev || Ev->getLoop() != CurLoop) in processLoopMemSet()
880 if (!SE->isLoopInvariant(MemsetSizeSCEV, CurLoop)) { in processLoopMemSet()
899 SE->applyLoopGuards(PositiveStrideSCEV, CurLoop); in processLoopMemSet()
901 SE->applyLoopGuards(MemsetSizeSCEV, CurLoop); in processLoopMemSet()
918 if (!SplatValue || !CurLoop->isLoopInvariant(SplatValue)) in processLoopMemSet()
989 const SCEV *StoreSizeSCEV, Loop *CurLoop, in getNumBytes() argument
992 SE->getTripCountFromExitCount(BECount, IntPtr, CurLoop); in getNumBytes()
1019 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in processLoopStridedStore()
1055 if (mayLoopAccessLocation(BasePtr, ModRefInfo::ModRef, CurLoop, BECount, in processLoopStridedStore()
1065 getNumBytes(BECount, IntIdxTy, StoreSizeSCEV, CurLoop, DL, SE); in processLoopStridedStore()
1253 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in processLoopStoreOfLoopLoad()
1303 mayLoopAccessLocation(StoreBasePtr, ModRefInfo::ModRef, CurLoop, BECount, in processLoopStoreOfLoopLoad()
1312 if (mayLoopAccessLocation(StoreBasePtr, ModRefInfo::ModRef, CurLoop, in processLoopStoreOfLoopLoad()
1345 if (mayLoopAccessLocation(LoadBasePtr, ModRefInfo::Mod, CurLoop, BECount, in processLoopStoreOfLoopLoad()
1369 getNumBytes(BECount, IntIdxTy, StoreSizeSCEV, CurLoop, DL, SE); in processLoopStoreOfLoopLoad()
1468 if (ApplyCodeSizeHeuristics && CurLoop->getNumBlocks() > 1) { in avoidLIRForMultiBlockLoop()
1469 if (CurLoop->isOutermost() && (!IsMemset || !IsLoopMemset)) { in avoidLIRForMultiBlockLoop()
1470 LLVM_DEBUG(dbgs() << " " << CurLoop->getHeader()->getParent()->getName() in avoidLIRForMultiBlockLoop()
1482 << CurLoop->getHeader()->getParent()->getName() in runOnNoncountableLoop()
1484 << CurLoop->getHeader()->getName() << "\n"); in runOnNoncountableLoop()
1557 static bool detectPopcountIdiom(Loop *CurLoop, BasicBlock *PreCondBB, in detectPopcountIdiom() argument
1570 LoopEntry = *(CurLoop->block_begin()); in detectPopcountIdiom()
1651 Value *T = matchCondition(PreCondBr, CurLoop->getLoopPreheader()); in detectPopcountIdiom()
1690 static bool detectShiftUntilZeroIdiom(Loop *CurLoop, const DataLayout &DL, in detectShiftUntilZeroIdiom() argument
1700 LoopEntry = *(CurLoop->block_begin()); in detectShiftUntilZeroIdiom()
1724 InitX = PhiX->getIncomingValueForBlock(CurLoop->getLoopPreheader()); in detectShiftUntilZeroIdiom()
1766 if (CurLoop->getNumBackEdges() != 1 || CurLoop->getNumBlocks() != 1) in recognizeAndInsertFFS()
1778 if (!detectShiftUntilZeroIdiom(CurLoop, *DL, IntrinID, InitX, in recognizeAndInsertFFS()
1784 if (!CurLoop->contains(cast<Instruction>(U))) { in recognizeAndInsertFFS()
1790 if (!CurLoop->contains(cast<Instruction>(U))) { in recognizeAndInsertFFS()
1805 BasicBlock *PH = CurLoop->getLoopPreheader(); in recognizeAndInsertFFS()
1838 auto InstWithoutDebugIt = CurLoop->getHeader()->instructionsWithoutDebug(); in recognizeAndInsertFFS()
1869 if (CurLoop->getNumBackEdges() != 1 || CurLoop->getNumBlocks() != 1) in recognizePopcount()
1872 BasicBlock *LoopBody = *(CurLoop->block_begin()); in recognizePopcount()
1879 BasicBlock *PH = CurLoop->getLoopPreheader(); in recognizePopcount()
1898 if (!detectPopcountIdiom(CurLoop, PreCondBB, CntInst, CntPhi, Val)) in recognizePopcount()
2023 BasicBlock *Body = *(CurLoop->block_begin()); in transformLoopToCountable()
2052 SE->forgetLoop(CurLoop); in transformLoopToCountable()
2058 BasicBlock *PreHead = CurLoop->getLoopPreheader(); in transformLoopToPopcount()
2128 BasicBlock *Body = *(CurLoop->block_begin()); in transformLoopToPopcount()
2159 SE->forgetLoop(CurLoop); in transformLoopToPopcount()
2203 static bool detectShiftUntilBitTestIdiom(Loop *CurLoop, Value *&BaseX, in detectShiftUntilBitTestIdiom() argument
2210 if (CurLoop->getNumBlocks() != 1 || CurLoop->getNumBackEdges() != 1) { in detectShiftUntilBitTestIdiom()
2215 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in detectShiftUntilBitTestIdiom()
2216 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in detectShiftUntilBitTestIdiom()
2242 CurLoop)))); in detectShiftUntilBitTestIdiom()
2275 assert(CurLoop->isLoopInvariant(BaseX) && in detectShiftUntilBitTestIdiom()
2361 if (!detectShiftUntilBitTestIdiom(CurLoop, X, BitMask, BitPos, XCurr, in recognizeShiftUntilBitTest()
2372 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in recognizeShiftUntilBitTest()
2373 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in recognizeShiftUntilBitTest()
2376 BasicBlock *SuccessorBB = CurLoop->getExitBlock(); in recognizeShiftUntilBitTest()
2447 BitPos, XMaskedLeadingOnePos, CurLoop->getName() + ".backedgetakencount", in recognizeShiftUntilBitTest()
2453 CurLoop->getName() + ".tripcount", /*HasNUW=*/true, in recognizeShiftUntilBitTest()
2497 auto *IV = Builder.CreatePHI(Ty, 2, CurLoop->getName() + ".iv"); in recognizeShiftUntilBitTest()
2508 CurLoop->getName() + ".ivcheck"); in recognizeShiftUntilBitTest()
2519 SE->forgetLoop(CurLoop); in recognizeShiftUntilBitTest()
2557 static bool detectShiftUntilZeroIdiom(Loop *CurLoop, ScalarEvolution *SE, in detectShiftUntilZeroIdiom() argument
2567 if (CurLoop->getNumBlocks() != 1 || CurLoop->getNumBackEdges() != 1) { in detectShiftUntilZeroIdiom()
2575 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in detectShiftUntilZeroIdiom()
2576 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in detectShiftUntilZeroIdiom()
2597 if (!match(ValShifted, m_Shift(m_LoopInvariant(m_Value(Val), CurLoop), in detectShiftUntilZeroIdiom()
2608 m_LoopInvariant(m_Value(ExtraOffset), CurLoop))) && in detectShiftUntilZeroIdiom()
2613 m_LoopInvariant(m_Value(ExtraOffset), CurLoop))) && in detectShiftUntilZeroIdiom()
2662 !isMustProgress(CurLoop) && !SE->isKnownNonNegative(SE->getSCEV(Val))) { in detectShiftUntilZeroIdiom()
2734 if (!detectShiftUntilZeroIdiom(CurLoop, SE, ValShiftedIsZero, IntrID, IV, in recognizeShiftUntilZero()
2745 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in recognizeShiftUntilZero()
2746 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in recognizeShiftUntilZero()
2749 BasicBlock *SuccessorBB = CurLoop->getExitBlock(); in recognizeShiftUntilZero()
2802 IVFinal, Start, CurLoop->getName() + ".backedgetakencount", in recognizeShiftUntilZero()
2809 CurLoop->getName() + ".tripcount", /*HasNUW=*/true, in recognizeShiftUntilZero()
2821 auto *CIV = Builder.CreatePHI(Ty, 2, CurLoop->getName() + ".iv"); in recognizeShiftUntilZero()
2831 CurLoop->getName() + ".ivcheck"); in recognizeShiftUntilZero()
2855 SE->forgetLoop(CurLoop); in recognizeShiftUntilZero()