Lines Matching refs:CurLoop
150 Loop *CurLoop = nullptr; member in __anonb3094e750111::LoopIdiomRecognize
359 CurLoop = L; in runOnLoop()
386 const SCEV *BECount = SE->getBackedgeTakenCount(CurLoop); in runOnCountableLoop()
398 CurLoop->getUniqueExitBlocks(ExitBlocks); in runOnCountableLoop()
401 << CurLoop->getHeader()->getParent()->getName() in runOnCountableLoop()
402 << "] Countable Loop %" << CurLoop->getHeader()->getName() in runOnCountableLoop()
408 SafetyInfo.computeLoopSafetyInfo(CurLoop); in runOnCountableLoop()
415 for (auto *BB : CurLoop->getBlocks()) { in runOnCountableLoop()
417 if (LI->getLoopFor(BB) != CurLoop) in runOnCountableLoop()
508 if (!StoreEv || StoreEv->getLoop() != CurLoop || !StoreEv->isAffine()) in isLegalStore()
531 CurLoop->isLoopInvariant(SplatValue)) { in isLegalStore()
567 if (!LoadEv || LoadEv->getLoop() != CurLoop || !LoadEv->isAffine()) in isLegalStore()
845 if (!StoreEv || StoreEv->getLoop() != CurLoop || !StoreEv->isAffine()) in processLoopMemCpy()
848 if (!LoadEv || LoadEv->getLoop() != CurLoop || !LoadEv->isAffine()) in processLoopMemCpy()
911 if (!Ev || Ev->getLoop() != CurLoop) in processLoopMemSet()
953 if (!SE->isLoopInvariant(MemsetSizeSCEV, CurLoop)) { in processLoopMemSet()
972 SE->applyLoopGuards(PositiveStrideSCEV, CurLoop); in processLoopMemSet()
974 SE->applyLoopGuards(MemsetSizeSCEV, CurLoop); in processLoopMemSet()
991 if (!SplatValue || !CurLoop->isLoopInvariant(SplatValue)) in processLoopMemSet()
1056 Loop *CurLoop, const DataLayout *DL, in getTripCount() argument
1068 CurLoop, ICmpInst::ICMP_NE, BECount, in getTripCount()
1086 const SCEV *StoreSizeSCEV, Loop *CurLoop, in getNumBytes() argument
1088 const SCEV *TripCountSCEV = getTripCount(BECount, IntPtr, CurLoop, DL, SE); in getNumBytes()
1116 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in processLoopStridedStore()
1152 if (mayLoopAccessLocation(BasePtr, ModRefInfo::ModRef, CurLoop, BECount, in processLoopStridedStore()
1162 getNumBytes(BECount, IntIdxTy, StoreSizeSCEV, CurLoop, DL, SE); in processLoopStridedStore()
1335 BasicBlock *Preheader = CurLoop->getLoopPreheader(); in processLoopStoreOfLoopLoad()
1385 mayLoopAccessLocation(StoreBasePtr, ModRefInfo::ModRef, CurLoop, BECount, in processLoopStoreOfLoopLoad()
1394 if (mayLoopAccessLocation(StoreBasePtr, ModRefInfo::ModRef, CurLoop, in processLoopStoreOfLoopLoad()
1427 if (mayLoopAccessLocation(LoadBasePtr, ModRefInfo::Mod, CurLoop, BECount, in processLoopStoreOfLoopLoad()
1451 getNumBytes(BECount, IntIdxTy, StoreSizeSCEV, CurLoop, DL, SE); in processLoopStoreOfLoopLoad()
1551 if (ApplyCodeSizeHeuristics && CurLoop->getNumBlocks() > 1) { in avoidLIRForMultiBlockLoop()
1552 if (CurLoop->isOutermost() && (!IsMemset || !IsLoopMemset)) { in avoidLIRForMultiBlockLoop()
1553 LLVM_DEBUG(dbgs() << " " << CurLoop->getHeader()->getParent()->getName() in avoidLIRForMultiBlockLoop()
1565 << CurLoop->getHeader()->getParent()->getName() in runOnNoncountableLoop()
1567 << CurLoop->getHeader()->getName() << "\n"); in runOnNoncountableLoop()
1640 static bool detectPopcountIdiom(Loop *CurLoop, BasicBlock *PreCondBB, in detectPopcountIdiom() argument
1653 LoopEntry = *(CurLoop->block_begin()); in detectPopcountIdiom()
1734 Value *T = matchCondition(PreCondBr, CurLoop->getLoopPreheader()); in detectPopcountIdiom()
1773 static bool detectShiftUntilZeroIdiom(Loop *CurLoop, const DataLayout &DL, in detectShiftUntilZeroIdiom() argument
1783 LoopEntry = *(CurLoop->block_begin()); in detectShiftUntilZeroIdiom()
1807 InitX = PhiX->getIncomingValueForBlock(CurLoop->getLoopPreheader()); in detectShiftUntilZeroIdiom()
1849 if (CurLoop->getNumBackEdges() != 1 || CurLoop->getNumBlocks() != 1) in recognizeAndInsertFFS()
1861 if (!detectShiftUntilZeroIdiom(CurLoop, *DL, IntrinID, InitX, in recognizeAndInsertFFS()
1867 if (!CurLoop->contains(cast<Instruction>(U))) { in recognizeAndInsertFFS()
1873 if (!CurLoop->contains(cast<Instruction>(U))) { in recognizeAndInsertFFS()
1888 BasicBlock *PH = CurLoop->getLoopPreheader(); in recognizeAndInsertFFS()
1921 auto InstWithoutDebugIt = CurLoop->getHeader()->instructionsWithoutDebug(); in recognizeAndInsertFFS()
1952 if (CurLoop->getNumBackEdges() != 1 || CurLoop->getNumBlocks() != 1) in recognizePopcount()
1955 BasicBlock *LoopBody = *(CurLoop->block_begin()); in recognizePopcount()
1962 BasicBlock *PH = CurLoop->getLoopPreheader(); in recognizePopcount()
1981 if (!detectPopcountIdiom(CurLoop, PreCondBB, CntInst, CntPhi, Val)) in recognizePopcount()
2106 BasicBlock *Body = *(CurLoop->block_begin()); in transformLoopToCountable()
2134 SE->forgetLoop(CurLoop); in transformLoopToCountable()
2140 BasicBlock *PreHead = CurLoop->getLoopPreheader(); in transformLoopToPopcount()
2210 BasicBlock *Body = *(CurLoop->block_begin()); in transformLoopToPopcount()
2240 SE->forgetLoop(CurLoop); in transformLoopToPopcount()
2284 static bool detectShiftUntilBitTestIdiom(Loop *CurLoop, Value *&BaseX, in detectShiftUntilBitTestIdiom() argument
2291 if (CurLoop->getNumBlocks() != 1 || CurLoop->getNumBackEdges() != 1) { in detectShiftUntilBitTestIdiom()
2296 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in detectShiftUntilBitTestIdiom()
2297 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in detectShiftUntilBitTestIdiom()
2323 CurLoop)))); in detectShiftUntilBitTestIdiom()
2356 assert(CurLoop->isLoopInvariant(BaseX) && in detectShiftUntilBitTestIdiom()
2442 if (!detectShiftUntilBitTestIdiom(CurLoop, X, BitMask, BitPos, XCurr, in recognizeShiftUntilBitTest()
2453 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in recognizeShiftUntilBitTest()
2454 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in recognizeShiftUntilBitTest()
2457 BasicBlock *SuccessorBB = CurLoop->getExitBlock(); in recognizeShiftUntilBitTest()
2510 BitPos, XMaskedLeadingOnePos, CurLoop->getName() + ".backedgetakencount", in recognizeShiftUntilBitTest()
2516 CurLoop->getName() + ".tripcount", /*HasNUW=*/true, in recognizeShiftUntilBitTest()
2560 auto *IV = Builder.CreatePHI(Ty, 2, CurLoop->getName() + ".iv"); in recognizeShiftUntilBitTest()
2571 CurLoop->getName() + ".ivcheck"); in recognizeShiftUntilBitTest()
2582 SE->forgetLoop(CurLoop); in recognizeShiftUntilBitTest()
2620 static bool detectShiftUntilZeroIdiom(Loop *CurLoop, ScalarEvolution *SE, in detectShiftUntilZeroIdiom() argument
2630 if (CurLoop->getNumBlocks() != 1 || CurLoop->getNumBackEdges() != 1) { in detectShiftUntilZeroIdiom()
2638 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in detectShiftUntilZeroIdiom()
2639 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in detectShiftUntilZeroIdiom()
2660 if (!match(ValShifted, m_Shift(m_LoopInvariant(m_Value(Val), CurLoop), in detectShiftUntilZeroIdiom()
2671 m_LoopInvariant(m_Value(ExtraOffset), CurLoop))) && in detectShiftUntilZeroIdiom()
2676 m_LoopInvariant(m_Value(ExtraOffset), CurLoop))) && in detectShiftUntilZeroIdiom()
2725 !isMustProgress(CurLoop) && !SE->isKnownNonNegative(SE->getSCEV(Val))) { in detectShiftUntilZeroIdiom()
2797 if (!detectShiftUntilZeroIdiom(CurLoop, SE, ValShiftedIsZero, IntrID, IV, in recognizeShiftUntilZero()
2808 BasicBlock *LoopHeaderBB = CurLoop->getHeader(); in recognizeShiftUntilZero()
2809 BasicBlock *LoopPreheaderBB = CurLoop->getLoopPreheader(); in recognizeShiftUntilZero()
2812 BasicBlock *SuccessorBB = CurLoop->getExitBlock(); in recognizeShiftUntilZero()
2865 IVFinal, Start, CurLoop->getName() + ".backedgetakencount", in recognizeShiftUntilZero()
2872 CurLoop->getName() + ".tripcount", /*HasNUW=*/true, in recognizeShiftUntilZero()
2884 auto *CIV = Builder.CreatePHI(Ty, 2, CurLoop->getName() + ".iv"); in recognizeShiftUntilZero()
2894 CurLoop->getName() + ".ivcheck"); in recognizeShiftUntilZero()
2918 SE->forgetLoop(CurLoop); in recognizeShiftUntilZero()