Lines Matching refs:CurLoop
139 Loop *CurLoop = nullptr; member in __anon360f5f450111::LoopIdiomRecognize
291 CurLoop = L; in runOnLoop()
318 const SCEV *BECount = SE->getBackedgeTakenCount(CurLoop); in runOnCountableLoop()
330 CurLoop->getUniqueExitBlocks(ExitBlocks); in runOnCountableLoop()
333 << CurLoop->getHeader()->getParent()->getName() in runOnCountableLoop()
334 << "] Countable Loop %" << CurLoop->getHeader()->getName() in runOnCountableLoop()
340 SafetyInfo.computeLoopSafetyInfo(CurLoop); in runOnCountableLoop()
347 for (auto *BB : CurLoop->getBlocks()) { in runOnCountableLoop()
349 if (LI->getLoopFor(BB) != CurLoop) in runOnCountableLoop()
440 if (!StoreEv || StoreEv->getLoop() != CurLoop || !StoreEv->isAffine()) in isLegalStore()
463 CurLoop->isLoopInvariant(SplatValue)) { in isLegalStore()
499 if (!LoadEv || LoadEv->getLoop() != CurLoop || !LoadEv->isAffine()) in isLegalStore()
777 if (!StoreEv || StoreEv->getLoop() != CurLoop || !StoreEv->isAffine()) in processLoopMemCpy()
780 if (!LoadEv || LoadEv->getLoop() != CurLoop || !LoadEv->isAffine()) in processLoopMemCpy()
843 if (!Ev || Ev->getLoop() != CurLoop) in processLoopMemSet()
885 if (!SE->isLoopInvariant(MemsetSizeSCEV, CurLoop)) { in processLoopMemSet()
904 SE->applyLoopGuards(PositiveStrideSCEV, CurLoop); in processLoopMemSet()
906 SE->applyLoopGuards(MemsetSizeSCEV, CurLoop); in processLoopMemSet()
923 if (!SplatValue || !CurLoop->isLoopInvariant(SplatValue)) in processLoopMemSet()
994 const SCEV *StoreSizeSCEV, Loop *CurLoop, in getNumBytes() argument
997 SE->getTripCountFromExitCount(BECount, IntPtr, CurLoop); in getNumBytes()
1024 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in processLoopStridedStore()
1060 if (mayLoopAccessLocation(BasePtr, ModRefInfo::ModRef, CurLoop, BECount, in processLoopStridedStore()
1070 getNumBytes(BECount, IntIdxTy, StoreSizeSCEV, CurLoop, DL, SE); in processLoopStridedStore()
1258 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in processLoopStoreOfLoopLoad()
1308 mayLoopAccessLocation(StoreBasePtr, ModRefInfo::ModRef, CurLoop, BECount, in processLoopStoreOfLoopLoad()
1317 if (mayLoopAccessLocation(StoreBasePtr, ModRefInfo::ModRef, CurLoop, in processLoopStoreOfLoopLoad()
1350 if (mayLoopAccessLocation(LoadBasePtr, ModRefInfo::Mod, CurLoop, BECount, in processLoopStoreOfLoopLoad()
1374 getNumBytes(BECount, IntIdxTy, StoreSizeSCEV, CurLoop, DL, SE); in processLoopStoreOfLoopLoad()
1473 if (ApplyCodeSizeHeuristics && CurLoop->getNumBlocks() > 1) { in avoidLIRForMultiBlockLoop()
1474 if (CurLoop->isOutermost() && (!IsMemset || !IsLoopMemset)) { in avoidLIRForMultiBlockLoop()
1475 LLVM_DEBUG(dbgs() << " " << CurLoop->getHeader()->getParent()->getName() in avoidLIRForMultiBlockLoop()
1487 << CurLoop->getHeader()->getParent()->getName() in runOnNoncountableLoop()
1489 << CurLoop->getHeader()->getName() << "\n"); in runOnNoncountableLoop()
1594 static bool detectShiftUntilLessThanIdiom(Loop *CurLoop, const DataLayout &DL, in detectShiftUntilLessThanIdiom() argument
1604 LoopEntry = *(CurLoop->block_begin()); in detectShiftUntilLessThanIdiom()
1636 InitX = VarPhi->getIncomingValueForBlock(CurLoop->getLoopPreheader()); in detectShiftUntilLessThanIdiom()
1692 static bool detectPopcountIdiom(Loop *CurLoop, BasicBlock *PreCondBB, in detectPopcountIdiom() argument
1705 LoopEntry = *(CurLoop->block_begin()); in detectPopcountIdiom()
1786 Value *T = matchCondition(PreCondBr, CurLoop->getLoopPreheader()); in detectPopcountIdiom()
1825 static bool detectShiftUntilZeroIdiom(Loop *CurLoop, const DataLayout &DL, in detectShiftUntilZeroIdiom() argument
1835 LoopEntry = *(CurLoop->block_begin()); in detectShiftUntilZeroIdiom()
1859 InitX = PhiX->getIncomingValueForBlock(CurLoop->getLoopPreheader()); in detectShiftUntilZeroIdiom()
1905 auto InstWithoutDebugIt = CurLoop->getHeader()->instructionsWithoutDebug(); in isProfitableToInsertFFS()
1927 if (!CurLoop->contains(cast<Instruction>(U))) { in insertFFSIfProfitable()
1933 if (!CurLoop->contains(cast<Instruction>(U))) { in insertFFSIfProfitable()
1948 BasicBlock *PH = CurLoop->getLoopPreheader(); in insertFFSIfProfitable()
1988 if (CurLoop->getNumBackEdges() != 1 || CurLoop->getNumBlocks() != 1) in recognizeAndInsertFFS()
1997 if (!detectShiftUntilZeroIdiom(CurLoop, *DL, IntrinID, InitX, CntInst, CntPhi, in recognizeAndInsertFFS()
2006 if (CurLoop->getNumBackEdges() != 1 || CurLoop->getNumBlocks() != 1) in recognizeShiftUntilLessThan()
2016 if (!detectShiftUntilLessThanIdiom(CurLoop, *DL, IntrinID, InitX, CntInst, in recognizeShiftUntilLessThan()
2031 if (!CurLoop->contains(cast<Instruction>(U))) in recognizeShiftUntilLessThan()
2036 BasicBlock *PH = CurLoop->getLoopPreheader(); in recognizeShiftUntilLessThan()
2084 if (CurLoop->getNumBackEdges() != 1 || CurLoop->getNumBlocks() != 1) in recognizePopcount()
2087 BasicBlock *LoopBody = *(CurLoop->block_begin()); in recognizePopcount()
2094 BasicBlock *PH = CurLoop->getLoopPreheader(); in recognizePopcount()
2113 if (!detectPopcountIdiom(CurLoop, PreCondBB, CntInst, CntPhi, Val)) in recognizePopcount()
2240 BasicBlock *Body = *(CurLoop->block_begin()); in transformLoopToCountable()
2269 SE->forgetLoop(CurLoop); in transformLoopToCountable()
2275 BasicBlock *PreHead = CurLoop->getLoopPreheader(); in transformLoopToPopcount()
2345 BasicBlock *Body = *(CurLoop->block_begin()); in transformLoopToPopcount()
2376 SE->forgetLoop(CurLoop); in transformLoopToPopcount()
2420 static bool detectShiftUntilBitTestIdiom(Loop *CurLoop, Value *&BaseX, in detectShiftUntilBitTestIdiom() argument
2427 if (CurLoop->getNumBlocks() != 1 || CurLoop->getNumBackEdges() != 1) { in detectShiftUntilBitTestIdiom()
2432 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in detectShiftUntilBitTestIdiom()
2433 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in detectShiftUntilBitTestIdiom()
2459 CurLoop)))); in detectShiftUntilBitTestIdiom()
2492 assert(CurLoop->isLoopInvariant(BaseX) && in detectShiftUntilBitTestIdiom()
2578 if (!detectShiftUntilBitTestIdiom(CurLoop, X, BitMask, BitPos, XCurr, in recognizeShiftUntilBitTest()
2589 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in recognizeShiftUntilBitTest()
2590 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in recognizeShiftUntilBitTest()
2593 BasicBlock *SuccessorBB = CurLoop->getExitBlock(); in recognizeShiftUntilBitTest()
2664 BitPos, XMaskedLeadingOnePos, CurLoop->getName() + ".backedgetakencount", in recognizeShiftUntilBitTest()
2670 CurLoop->getName() + ".tripcount", /*HasNUW=*/true, in recognizeShiftUntilBitTest()
2714 auto *IV = Builder.CreatePHI(Ty, 2, CurLoop->getName() + ".iv"); in recognizeShiftUntilBitTest()
2725 CurLoop->getName() + ".ivcheck"); in recognizeShiftUntilBitTest()
2736 SE->forgetLoop(CurLoop); in recognizeShiftUntilBitTest()
2774 static bool detectShiftUntilZeroIdiom(Loop *CurLoop, ScalarEvolution *SE, in detectShiftUntilZeroIdiom() argument
2784 if (CurLoop->getNumBlocks() != 1 || CurLoop->getNumBackEdges() != 1) { in detectShiftUntilZeroIdiom()
2792 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in detectShiftUntilZeroIdiom()
2793 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in detectShiftUntilZeroIdiom()
2814 if (!match(ValShifted, m_Shift(m_LoopInvariant(m_Value(Val), CurLoop), in detectShiftUntilZeroIdiom()
2825 m_LoopInvariant(m_Value(ExtraOffset), CurLoop))) && in detectShiftUntilZeroIdiom()
2830 m_LoopInvariant(m_Value(ExtraOffset), CurLoop))) && in detectShiftUntilZeroIdiom()
2879 !isMustProgress(CurLoop) && !SE->isKnownNonNegative(SE->getSCEV(Val))) { in detectShiftUntilZeroIdiom()
2951 if (!detectShiftUntilZeroIdiom(CurLoop, SE, ValShiftedIsZero, IntrID, IV, in recognizeShiftUntilZero()
2962 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in recognizeShiftUntilZero()
2963 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in recognizeShiftUntilZero()
2966 BasicBlock *SuccessorBB = CurLoop->getExitBlock(); in recognizeShiftUntilZero()
3019 IVFinal, Start, CurLoop->getName() + ".backedgetakencount", in recognizeShiftUntilZero()
3026 CurLoop->getName() + ".tripcount", /*HasNUW=*/true, in recognizeShiftUntilZero()
3038 auto *CIV = Builder.CreatePHI(Ty, 2, CurLoop->getName() + ".iv"); in recognizeShiftUntilZero()
3048 CurLoop->getName() + ".ivcheck"); in recognizeShiftUntilZero()
3072 SE->forgetLoop(CurLoop); in recognizeShiftUntilZero()