llvm.org GIT mirror llvm / e87cf87
Use a BumpPtrAllocator for Loop objects Summary: And now that we no longer have to explicitly free() the Loop instances, we can (with more ease) use the destructor of LoopBase to do what LoopBase::clear() was doing. Reviewers: chandlerc Subscribers: mehdi_amini, mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D38201 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314375 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjoy Das 2 years ago
23 changed file(s) with 128 addition(s) and 77 deletion(s). Raw diff Collapse all Expand all
4545 #include "llvm/IR/Instructions.h"
4646 #include "llvm/IR/PassManager.h"
4747 #include "llvm/Pass.h"
48 #include "llvm/Support/Allocator.h"
4849 #include
50 #include
4951
5052 namespace llvm {
5153
7375
7476 SmallPtrSet DenseBlockSet;
7577
78 #if !defined(NDEBUG) || !LLVM_ENABLE_ABI_BREAKING_CHECKS
7679 /// Indicator that this loop is no longer a valid loop.
7780 bool IsInvalid = false;
81 #endif
7882
7983 LoopBase(const LoopBase &) = delete;
8084 const LoopBase &
8185 operator=(const LoopBase &) = delete;
8286
83 void clear() {
84 IsInvalid = true;
85 SubLoops.clear();
86 Blocks.clear();
87 DenseBlockSet.clear();
88 ParentLoop = nullptr;
89 }
90
9187 public:
92 /// This creates an empty loop.
93 LoopBase() : ParentLoop(nullptr) {}
94
9588 /// Return the nesting level of this loop. An outer-most loop has depth 1,
9689 /// for consistency with loop depth values used for basic blocks, where depth
9790 /// 0 is used for blocks not inside any loops.
171164 return Blocks.size();
172165 }
173166
174 /// Return true if this loop is no longer valid.
167 #ifndef NDEBUG
168 /// Return true if this loop is no longer valid. The only valid use of this
169 /// helper is "assert(L.isInvalid())" or equivalent, since IsInvalid is set to
170 /// false by the destructor. In other words, if this accessor returns false,
171 /// the caller has already triggered UB by calling this accessor; and so it
172 /// can only be called in a context where a return value of false indicates a
173 /// programmer error.
175174 bool isInvalid() const { return IsInvalid; }
175 #endif
176176
177177 /// True if terminator in the block can branch to another block that is
178178 /// outside of the current loop.
369369
370370 protected:
371371 friend class LoopInfoBase;
372
373 /// This creates an empty loop.
374 LoopBase() : ParentLoop(nullptr) {}
375
372376 explicit LoopBase(BlockT *BB) : ParentLoop(nullptr) {
373377 Blocks.push_back(BB);
374378 DenseBlockSet.insert(BB);
385389 // non-public.
386390 ~LoopBase() {
387391 for (auto *SubLoop : SubLoops)
388 delete SubLoop;
392 SubLoop->~LoopT();
393
394 IsInvalid = true;
395 SubLoops.clear();
396 Blocks.clear();
397 DenseBlockSet.clear();
398 ParentLoop = nullptr;
389399 }
390400 };
391401
420430 ///
421431 explicit operator bool() const { return Start && End; }
422432 };
423
424 Loop() {}
425433
426434 /// Return true if the specified value is loop invariant.
427435 bool isLoopInvariant(const Value *V) const;
533541 LocRange getLocRange() const;
534542
535543 StringRef getName() const {
536 if (isInvalid())
537 return "";
538544 if (BasicBlock *Header = getHeader())
539545 if (Header->hasName())
540546 return Header->getName();
542548 }
543549
544550 private:
551 Loop() = default;
552
545553 friend class LoopInfoBase;
546554 friend class LoopBase;
547555 explicit Loop(BasicBlock *BB) : LoopBase(BB) {}
557565 // BBMap - Mapping of basic blocks to the inner most loop they occur in
558566 DenseMap BBMap;
559567 std::vector TopLevelLoops;
560 std::vector RemovedLoops;
568 BumpPtrAllocator LoopAllocator;
561569
562570 friend class LoopBase;
563571 friend class LoopInfo;
571579
572580 LoopInfoBase(LoopInfoBase &&Arg)
573581 : BBMap(std::move(Arg.BBMap)),
574 TopLevelLoops(std::move(Arg.TopLevelLoops)) {
582 TopLevelLoops(std::move(Arg.TopLevelLoops)),
583 LoopAllocator(std::move(Arg.LoopAllocator)) {
575584 // We have to clear the arguments top level loops as we've taken ownership.
576585 Arg.TopLevelLoops.clear();
577586 }
579588 BBMap = std::move(RHS.BBMap);
580589
581590 for (auto *L : TopLevelLoops)
582 delete L;
591 L->~LoopT();
592
583593 TopLevelLoops = std::move(RHS.TopLevelLoops);
594 LoopAllocator = std::move(RHS.LoopAllocator);
584595 RHS.TopLevelLoops.clear();
585596 return *this;
586597 }
589600 BBMap.clear();
590601
591602 for (auto *L : TopLevelLoops)
592 delete L;
603 L->~LoopT();
593604 TopLevelLoops.clear();
594 for (auto *L : RemovedLoops)
595 delete L;
596 RemovedLoops.clear();
605 LoopAllocator.Reset();
606 }
607
608 template LoopT *AllocateLoop(ArgsTy &&... Args) {
609 LoopT *Storage = LoopAllocator.Allocate();
610 return new (Storage) LoopT(std::forward(Args)...);
597611 }
598612
599613 /// iterator/begin/end - The interface to the top-level loops in the current
716730 void verify(const DominatorTreeBase &DomTree) const;
717731
718732 protected:
719 static void clearLoop(LoopT &L) { L.clear(); }
733 // Calls the destructor for \p L but keeps the memory for \p L around so that
734 // the pointer value does not get re-used.
735 void destroy(LoopT *L) {
736 L->~LoopT();
737
738 // Since LoopAllocator is a BumpPtrAllocator, this Deallocate only poisons
739 // \c L, but the pointer remains valid for non-dereferencing uses.
740 LoopAllocator.Deallocate(L, sizeof(LoopT));
741 }
720742 };
721743
722744 // Implementation in LoopInfoImpl.h
497497 }
498498 // Perform a backward CFG traversal to discover and map blocks in this loop.
499499 if (!Backedges.empty()) {
500 LoopT *L = new LoopT(Header);
500 LoopT *L = AllocateLoop(Header);
501501 discoverAndMapSubloop(L, ArrayRef(Backedges), this, DomTree);
502502 }
503503 }
128128 // Add a new loop into the loop queue.
129129 void addLoop(Loop &L);
130130
131 // Mark \p L as deleted.
132 void markLoopAsDeleted(Loop &L);
133
131134 //===--------------------------------------------------------------------===//
132135 /// SimpleAnalysis - Provides simple interface to update analysis info
133136 /// maintained by various passes. Note, if required this interface can
151154 std::deque LQ;
152155 LoopInfo *LI;
153156 Loop *CurrentLoop;
157 bool CurrentLoopDeleted;
154158 };
155159
156160 // This pass is required by the LCSSA transformation. It is used inside
4343
4444 class MachineLoop : public LoopBase {
4545 public:
46 MachineLoop();
47
4846 /// Return the "top" block in the loop, which is the first block in the linear
4947 /// layout, ignoring any parts of the loop not contiguous with the part that
5048 /// contains the header.
7573
7674 explicit MachineLoop(MachineBasicBlock *MBB)
7775 : LoopBase(MBB) {}
76
77 MachineLoop() = default;
7878 };
7979
8080 // Implementation in LoopInfoImpl.h
653653 /// This doesn't invalidate, but instead simply deletes, the relevant results.
654654 /// It is useful when the IR is being removed and we want to clear out all the
655655 /// memory pinned for it.
656 void clear(IRUnitT &IR) {
656 void clear(IRUnitT &IR, llvm::StringRef Name) {
657657 if (DebugLogging)
658 dbgs() << "Clearing all analysis results for: " << IR.getName() << "\n";
658 dbgs() << "Clearing all analysis results for: " << Name << "\n";
659659
660660 auto ResultsListI = AnalysisResultLists.find(&IR);
661661 if (ResultsListI == AnalysisResultLists.end())
268268 // Pull in base class overloads.
269269 using AllocatorBase::Allocate;
270270
271 // Bump pointer allocators are expected to never free their storage; and
272 // clients expect pointers to remain valid for non-dereferencing uses even
273 // after deallocation.
271274 void Deallocate(const void *Ptr, size_t Size) {
272275 __asan_poison_memory_region(Ptr, Size);
273276 }
163163 /// If this is called for the current loop, in addition to clearing any
164164 /// state, this routine will mark that the current loop should be skipped by
165165 /// the rest of the pass management infrastructure.
166 void markLoopAsDeleted(Loop &L) {
167 LAM.clear(L);
166 void markLoopAsDeleted(Loop &L, llvm::StringRef Name) {
167 LAM.clear(L, Name);
168168 assert((&L == CurrentL || CurrentL->contains(&L)) &&
169169 "Cannot delete a loop outside of the "
170170 "subloop tree currently being processed.");
234234 auto PAC = PA.getChecker();
235235 if (!PAC.preserved() && !PAC.preservedSet>()) {
236236 for (LazyCallGraph::Node &N : C)
237 FAM->clear(N.getFunction());
237 FAM->clear(N.getFunction(), N.getFunction().getName());
238238
239239 return true;
240240 }
5656 // those results. Note that the order doesn't matter here as this will just
5757 // directly destroy the results without calling methods on them.
5858 for (Loop *L : PreOrderLoops)
59 InnerAM->clear(*L);
59 InnerAM->clear(*L, L->getName());
6060
6161 // We also need to null out the inner AM so that when the object gets
6262 // destroyed as invalid we don't try to clear the inner AM again. At that
619619
620620 void LoopInfo::erase(Loop *Unloop) {
621621 assert(!Unloop->isInvalid() && "Loop has already been erased!");
622 RemovedLoops.push_back(Unloop);
623
624 auto InvalidateOnExit =
625 make_scope_exit([&]() { BaseT::clearLoop(*Unloop); });
622
623 auto InvalidateOnExit = make_scope_exit([&]() { destroy(Unloop); });
626624
627625 // First handle the special case of no parent loop to simplify the algorithm.
628626 if (!Unloop->getParentLoop()) {
139139 Info.setPreservesAll();
140140 }
141141
142 void LPPassManager::markLoopAsDeleted(Loop &L) {
143 assert((&L == CurrentLoop || CurrentLoop->contains(&L)) &&
144 "Must not delete loop outside the current loop tree!");
145 if (&L == CurrentLoop)
146 CurrentLoopDeleted = true;
147 }
148
142149 /// run - Execute all of the passes scheduled for execution. Keep track of
143150 /// whether any of the passes modifies the function, and if so, return true.
144151 bool LPPassManager::runOnFunction(Function &F) {
175182
176183 // Walk Loops
177184 while (!LQ.empty()) {
178 bool LoopWasDeleted = false;
185 CurrentLoopDeleted = false;
179186 CurrentLoop = LQ.back();
180187
181188 // Run all passes on the current Loop.
194201
195202 Changed |= P->runOnLoop(CurrentLoop, *this);
196203 }
197 LoopWasDeleted = CurrentLoop->isInvalid();
198204
199205 if (Changed)
200 dumpPassInfo(P, MODIFICATION_MSG, ON_LOOP_MSG, CurrentLoop->getName());
206 dumpPassInfo(P, MODIFICATION_MSG, ON_LOOP_MSG,
207 CurrentLoopDeleted ? ""
208 : CurrentLoop->getName());
201209 dumpPreservedSet(P);
202210
203 if (LoopWasDeleted) {
211 if (CurrentLoopDeleted) {
204212 // Notify passes that the loop is being deleted.
205213 deleteSimpleAnalysisLoop(CurrentLoop);
206214 } else {
228236
229237 removeNotPreservedAnalysis(P);
230238 recordAvailableAnalysis(P);
231 removeDeadPasses(P, LoopWasDeleted ? ""
232 : CurrentLoop->getHeader()->getName(),
239 removeDeadPasses(P,
240 CurrentLoopDeleted ? ""
241 : CurrentLoop->getHeader()->getName(),
233242 ON_LOOP_MSG);
234243
235 if (LoopWasDeleted)
244 if (CurrentLoopDeleted)
236245 // Do not run other passes on this loop.
237246 break;
238247 }
240249 // If the loop was deleted, release all the loop passes. This frees up
241250 // some memory, and avoids trouble with the pass manager trying to call
242251 // verifyAnalysis on them.
243 if (LoopWasDeleted) {
252 if (CurrentLoopDeleted) {
244253 for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
245254 Pass *P = getContainedPass(Index);
246255 freePass(P, "", ON_LOOP_MSG);
358367 char LCSSAVerificationPass::ID = 0;
359368 INITIALIZE_PASS(LCSSAVerificationPass, "lcssa-verification", "LCSSA Verifier",
360369 false, false)
361
10431043 FunctionAnalysisManager &FAM =
10441044 AM.getResult(DeadC, CG)
10451045 .getManager();
1046 FAM.clear(*DeadF);
1047 AM.clear(DeadC);
1046 FAM.clear(*DeadF, DeadF->getName());
1047 AM.clear(DeadC, DeadC.getName());
10481048 auto &DeadRC = DeadC.getOuterRefSCC();
10491049 CG.removeDeadFunction(*DeadF);
10501050
7979 //
8080 Pass *llvm::createLoopExtractorPass() { return new LoopExtractor(); }
8181
82 bool LoopExtractor::runOnLoop(Loop *L, LPPassManager &) {
82 bool LoopExtractor::runOnLoop(Loop *L, LPPassManager &LPM) {
8383 if (skipLoop(L))
8484 return false;
8585
142142 Changed = true;
143143 // After extraction, the loop is replaced by a function call, so
144144 // we shouldn't try to run any more loop passes on it.
145 LPM.markLoopAsDeleted(*L);
145146 LI.erase(L);
146147 }
147148 ++NumExtracted;
13851385
13861386 Loop *LoopConstrainer::createClonedLoopStructure(Loop *Original, Loop *Parent,
13871387 ValueToValueMapTy &VM) {
1388 Loop &New = *new Loop();
1388 Loop &New = *LI.AllocateLoop();
13891389 if (Parent)
13901390 Parent->addChildLoop(&New);
13911391 else
347347
348348 DEBUG(dbgs() << "Analyzing Loop for deletion: ");
349349 DEBUG(L.dump());
350 std::string LoopName = L.getName();
350351 auto Result = deleteLoopIfDead(&L, AR.DT, AR.SE, AR.LI);
351352 if (Result == LoopDeletionResult::Unmodified)
352353 return PreservedAnalyses::all();
353354
354355 if (Result == LoopDeletionResult::Deleted)
355 Updater.markLoopAsDeleted(L);
356 Updater.markLoopAsDeleted(L, LoopName);
356357
357358 return getLoopPassPreservedAnalyses();
358359 }
383384
384385 Pass *llvm::createLoopDeletionPass() { return new LoopDeletionLegacyPass(); }
385386
386 bool LoopDeletionLegacyPass::runOnLoop(Loop *L, LPPassManager &) {
387 bool LoopDeletionLegacyPass::runOnLoop(Loop *L, LPPassManager &LPM) {
387388 if (skipLoop(L))
388389 return false;
389390 DominatorTree &DT = getAnalysis().getDomTree();
392393
393394 DEBUG(dbgs() << "Analyzing Loop for deletion: ");
394395 DEBUG(L->dump());
395 return deleteLoopIfDead(L, DT, SE, LI) != LoopDeletionResult::Unmodified;
396 }
396
397 LoopDeletionResult Result = deleteLoopIfDead(L, DT, SE, LI);
398
399 if (Result == LoopDeletionResult::Deleted)
400 LPM.markLoopAsDeleted(*L);
401
402 return Result != LoopDeletionResult::Unmodified;
403 }
10861086 Optional ProvidedUpperBound;
10871087 Optional ProvidedAllowPeeling;
10881088
1089 bool runOnLoop(Loop *L, LPPassManager &) override {
1089 bool runOnLoop(Loop *L, LPPassManager &LPM) override {
10901090 if (skipLoop(L))
10911091 return false;
10921092
11041104 OptimizationRemarkEmitter ORE(&F);
11051105 bool PreserveLCSSA = mustPreserveAnalysisID(LCSSAID);
11061106
1107 return tryToUnrollLoop(L, DT, LI, SE, TTI, AC, ORE, PreserveLCSSA, OptLevel,
1108 ProvidedCount, ProvidedThreshold,
1109 ProvidedAllowPartial, ProvidedRuntime,
1110 ProvidedUpperBound, ProvidedAllowPeeling) !=
1111 LoopUnrollResult::Unmodified;
1107 LoopUnrollResult Result = tryToUnrollLoop(
1108 L, DT, LI, SE, TTI, AC, ORE, PreserveLCSSA, OptLevel, ProvidedCount,
1109 ProvidedThreshold, ProvidedAllowPartial, ProvidedRuntime,
1110 ProvidedUpperBound, ProvidedAllowPeeling);
1111
1112 if (Result == LoopUnrollResult::FullyUnrolled)
1113 LPM.markLoopAsDeleted(*L);
1114
1115 return Result != LoopUnrollResult::Unmodified;
11121116 }
11131117
11141118 /// This transformation requires natural loop information & requires that
11721176 OldLoops.insert(ParentL->begin(), ParentL->end());
11731177 else
11741178 OldLoops.insert(AR.LI.begin(), AR.LI.end());
1179
1180 std::string LoopName = L.getName();
11751181
11761182 bool Changed =
11771183 tryToUnrollLoop(&L, AR.DT, &AR.LI, AR.SE, AR.TTI, AR.AC, *ORE,
12221228 Updater.addSiblingLoops(SibLoops);
12231229
12241230 if (!IsCurrentLoopValid) {
1225 Updater.markLoopAsDeleted(L);
1231 Updater.markLoopAsDeleted(L, LoopName);
12261232 } else {
12271233 // We can only walk child loops if the current loop remained valid.
12281234 if (UnrollRevisitChildLoops) {
13091315 // bloating it further.
13101316 if (PSI && PSI->hasHugeWorkingSetSize())
13111317 AllowPeeling = false;
1318 std::string LoopName = L.getName();
13121319 LoopUnrollResult Result =
13131320 tryToUnrollLoop(&L, DT, &LI, SE, TTI, AC, ORE,
13141321 /*PreserveLCSSA*/ true, OptLevel, /*Count*/ None,
13251332
13261333 // Clear any cached analysis results for L if we removed it completely.
13271334 if (LAM && Result == LoopUnrollResult::FullyUnrolled)
1328 LAM->clear(L);
1335 LAM->clear(L, LoopName);
13291336 }
13301337
13311338 if (!Changed)
880880 /// mapping the blocks with the specified map.
881881 static Loop *CloneLoop(Loop *L, Loop *PL, ValueToValueMapTy &VM,
882882 LoopInfo *LI, LPPassManager *LPM) {
883 Loop &New = *new Loop();
883 Loop &New = *LI->AllocateLoop();
884884 if (PL)
885885 PL->addChildLoop(&New);
886886 else
746746 Function *F = OrigLoop->getHeader()->getParent();
747747 Loop *ParentLoop = OrigLoop->getParentLoop();
748748
749 Loop *NewLoop = new Loop();
749 Loop *NewLoop = LI->AllocateLoop();
750750 if (ParentLoop)
751751 ParentLoop->addChildLoop(NewLoop);
752752 else
257257 placeSplitBlockCarefully(NewBB, OuterLoopPreds, L);
258258
259259 // Create the new outer loop.
260 Loop *NewOuter = new Loop();
260 Loop *NewOuter = LI->AllocateLoop();
261261
262262 // Change the parent loop to use the outer loop as its child now.
263263 if (Loop *Parent = L->getParentLoop())
199199 assert(OriginalBB == OldLoop->getHeader() &&
200200 "Header should be first in RPO");
201201
202 NewLoop = new Loop();
202 NewLoop = LI->AllocateLoop();
203203 Loop *NewLoopParent = NewLoops.lookup(OldLoop->getParentLoop());
204204
205205 if (NewLoopParent)
34553455 MiddleBlock->splitBasicBlock(MiddleBlock->getTerminator(), "scalar.ph");
34563456
34573457 // Create and register the new vector loop.
3458 Loop *Lp = new Loop();
3458 Loop *Lp = LI->AllocateLoop();
34593459 Loop *ParentLoop = OrigLoop->getParentLoop();
34603460
34613461 // Insert the new loop into the loop nest and register the new basic blocks
2121 ; CHECK: Running analysis: LoopAccessAnalysis on outer.header
2222 ; CHECK: Finished Loop pass manager run.
2323 ; CHECK: Running pass: LoopUnrollPass
24 ; CHECK: Clearing all analysis results for:
25 ; CHECK: Clearing all analysis results for:
24 ; CHECK: Clearing all analysis results for: inner2.header
25 ; CHECK: Clearing all analysis results for: outer.header
2626 ; CHECK: Invalidating all non-preserved analyses for: test
2727 ; CHECK: Invalidating all non-preserved analyses for: inner1.header
2828 ; CHECK: Invalidating analysis: LoopAccessAnalysis on inner1.header
945945 .WillOnce(Invoke([&](Loop &L, LoopAnalysisManager &AM,
946946 LoopStandardAnalysisResults &AR,
947947 LPMUpdater &Updater) {
948 auto *NewLoop = new Loop();
948 auto *NewLoop = AR.LI.AllocateLoop();
949949 L.addChildLoop(NewLoop);
950950 auto *NewLoop010PHBB =
951951 BasicBlock::Create(Context, "loop.0.1.0.ph", &F, &Loop02PHBB);
991991 .WillOnce(Invoke([&](Loop &L, LoopAnalysisManager &AM,
992992 LoopStandardAnalysisResults &AR,
993993 LPMUpdater &Updater) {
994 auto *NewLoop = new Loop();
994 auto *NewLoop = AR.LI.AllocateLoop();
995995 L.addChildLoop(NewLoop);
996996 auto *NewLoop011PHBB = BasicBlock::Create(Context, "loop.0.1.1.ph", &F, NewLoop01LatchBB);
997997 auto *NewLoop011BB = BasicBlock::Create(Context, "loop.0.1.1", &F, NewLoop01LatchBB);
11381138 .WillOnce(Invoke([&](Loop &L, LoopAnalysisManager &AM,
11391139 LoopStandardAnalysisResults &AR,
11401140 LPMUpdater &Updater) {
1141 auto *NewLoop = new Loop();
1141 auto *NewLoop = AR.LI.AllocateLoop();
11421142 L.getParentLoop()->addChildLoop(NewLoop);
11431143 auto *NewLoop01PHBB = BasicBlock::Create(Context, "loop.0.1.ph", &F, &Loop02PHBB);
11441144 auto *NewLoop01BB = BasicBlock::Create(Context, "loop.0.1", &F, &Loop02PHBB);
11801180 .WillOnce(Invoke([&](Loop &L, LoopAnalysisManager &AM,
11811181 LoopStandardAnalysisResults &AR,
11821182 LPMUpdater &Updater) {
1183 Loop *NewLoops[] = {new Loop(), new Loop(), new Loop()};
1183 Loop *NewLoops[] = {AR.LI.AllocateLoop(), AR.LI.AllocateLoop(),
1184 AR.LI.AllocateLoop()};
11841185 L.getParentLoop()->addChildLoop(NewLoops[0]);
11851186 L.getParentLoop()->addChildLoop(NewLoops[1]);
11861187 NewLoops[1]->addChildLoop(NewLoops[2]);
12591260 .WillOnce(Invoke([&](Loop &L, LoopAnalysisManager &AM,
12601261 LoopStandardAnalysisResults &AR,
12611262 LPMUpdater &Updater) {
1262 auto *NewLoop = new Loop();
1263 auto *NewLoop = AR.LI.AllocateLoop();
12631264 AR.LI.addTopLevelLoop(NewLoop);
12641265 auto *NewLoop1PHBB = BasicBlock::Create(Context, "loop.1.ph", &F, &Loop2BB);
12651266 auto *NewLoop1BB = BasicBlock::Create(Context, "loop.1", &F, &Loop2BB);
13771378 LoopStandardAnalysisResults &AR, LPMUpdater &Updater) {
13781379 assert(L.empty() && "Can only delete leaf loops with this routine!");
13791380 SmallVector LoopBBs(L.block_begin(), L.block_end());
1380 Updater.markLoopAsDeleted(L);
1381 Updater.markLoopAsDeleted(L, L.getName());
13811382 IDomBB.getTerminator()->replaceUsesOfWith(L.getHeader(),
13821383 L.getUniqueExitBlock());
13831384 for (BasicBlock *LoopBB : LoopBBs) {
14901491 EraseLoop(L, Loop02PHBB, AR, Updater);
14911492
14921493 // Now insert a new sibling loop.
1493 auto *NewSibling = new Loop;
1494 auto *NewSibling = AR.LI.AllocateLoop();
14941495 ParentL->addChildLoop(NewSibling);
14951496 NewLoop03PHBB =
14961497 BasicBlock::Create(Context, "loop.0.3.ph", &F, &Loop0LatchBB);