• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/Analysis/

Lines Matching refs:SCC

40 template class AllAnalysesOn<LazyCallGraph::SCC>;
41 template class AnalysisManager<LazyCallGraph::SCC, LazyCallGraph &>;
42 template class PassManager<LazyCallGraph::SCC, CGSCCAnalysisManager,
46 LazyCallGraph::SCC, LazyCallGraph &>;
53 PassManager<LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &,
54 CGSCCUpdateResult &>::run(LazyCallGraph::SCC &InitialC,
67 // The SCC may be refined while we are running passes over it, so set up
69 LazyCallGraph::SCC *C = &InitialC;
91 PI.runAfterPassInvalidated<LazyCallGraph::SCC>(*Pass);
93 PI.runAfterPass<LazyCallGraph::SCC>(*Pass, *C);
95 // Update the SCC if necessary.
104 // If the CGSCC pass wasn't able to provide a valid updated SCC, the
105 // current SCC may simply need to be skipped if invalid.
107 LLVM_DEBUG(dbgs() << "Skipping invalidated root or island SCC!\n");
111 assert(C->begin() != C->end() && "Cannot have an empty SCC!");
128 // Before we mark all of *this* SCC's analyses as preserved below, intersect
129 // this with the cross-SCC preserved analysis set. This is used to allow
135 // SCC. Therefore, the remaining analysis results in the AnalysisManager are
138 PA.preserveSet<AllAnalysesOn<LazyCallGraph::SCC>>();
160 // entire SCC layer as well rather than trying to do invalidation ourselves.
176 PA.allAnalysesInSetPreserved<AllAnalysesOn<LazyCallGraph::SCC>>();
186 // for this SCC.
209 // preserve all SCC analyses.
222 // be accessed in an SCC analysis and proxied onward to function passes.
233 FunctionAnalysisManagerCGSCCProxy::run(LazyCallGraph::SCC &C,
255 LazyCallGraph::SCC &C, const PreservedAnalyses &PA,
270 if (!PAC.preserved() && !PAC.preservedSet<AllAnalysesOn<LazyCallGraph::SCC>>()) {
288 // SCC-level analysis invalidation that triggers deferred invalidation
323 /// When a new SCC is created for the graph we first update the
326 /// that SCC, two forms of updates are required.
328 /// First, a proxy from the SCC to the FunctionAnalysisManager needs to be
329 /// created so that any subsequent invalidation events to the SCC are
332 /// Second, if any of the functions within the SCC have analysis results with
334 /// *wrong* SCC's analysis result. We forcibly invalidate the necessary
336 static void updateNewSCCFunctionAnalyses(LazyCallGraph::SCC &C,
342 // Now walk the functions in this SCC and invalidate any function analysis
343 // results that might have outer dependencies on an SCC analysis.
372 /// The range of new SCCs must be in postorder already. The SCC they were split
376 /// This function returns the SCC containing \p N. This will be either \p C if
377 /// no new SCCs have been split out, or it will be the new SCC containing \p N.
379 static LazyCallGraph::SCC *
381 LazyCallGraph::Node &N, LazyCallGraph::SCC *C,
383 using SCC = LazyCallGraph::SCC;
388 // Add the current SCC to the worklist as its shape has changed.
390 LLVM_DEBUG(dbgs() << "Enqueuing the existing SCC in the worklist:" << *C
393 SCC *OldC = C;
395 // Update the current SCC. Note that if we have new SCCs, this must actually
396 // change the SCC.
398 "Cannot insert new SCCs without changing current SCC!");
400 assert(G.lookupSCC(N) == C && "Failed to update current SCC!");
403 // them for each SCC that was split off.
409 // We need to propagate an invalidation call to all but the newly current SCC
420 // Ensure the now-current SCC's function analyses are updated.
424 for (SCC &NewC : llvm::reverse(make_range(std::next(NewSCCRange.begin()),
426 assert(C != &NewC && "No need to re-visit the current SCC!");
427 assert(OldC != &NewC && "Already handled the original SCC!");
429 LLVM_DEBUG(dbgs() << "Enqueuing a newly formed SCC:" << NewC << "\n");
435 // Also propagate a normal invalidation to the new SCC as only the current
442 static LazyCallGraph::SCC &updateCGAndAnalysisManagerForPass(
443 LazyCallGraph &G, LazyCallGraph::SCC &InitialC, LazyCallGraph::Node &N,
448 using SCC = LazyCallGraph::SCC;
452 SCC *C = &InitialC;
514 SCC &TargetC = *G.lookupSCC(*RefTarget);
525 SCC &TargetC = *G.lookupSCC(*CallTarget);
549 SCC &TargetC = *G.lookupSCC(E.getNode());
569 SCC &TargetC = *G.lookupSCC(*TargetN);
596 assert(G.lookupSCC(N) == C && "Changed the SCC when splitting RefSCCs!");
619 SCC &TargetC = *G.lookupSCC(*RefTarget);
648 SCC &TargetC = *G.lookupSCC(*CallTarget);
671 N, *CallTarget, [&](ArrayRef<SCC *> MergedSCCs) {
672 for (SCC *MergedC : MergedSCCs) {
673 assert(MergedC != &TargetC && "Cannot merge away the target SCC!");
679 // Mark that this SCC will no longer be valid.
695 assert(G.lookupSCC(N) == C && "Failed to update current SCC!");
698 // analysis manager, we need to create a proxy in the new current SCC as
703 // Any analyses cached for this SCC are no longer precise as the shape
711 // If we have actually moved an SCC to be topologically "below" the current
712 // one due to merging, we will need to revisit the current SCC after
715 // It is critical that we *do not* revisit the current SCC unless we
717 // form a cycle where an SCC is split apart, merged, split, merged and so
720 // Put our current SCC back onto the worklist as we'll visit other SCCs
723 // optimize the current SCC.
725 LLVM_DEBUG(dbgs() << "Enqueuing the existing SCC in the worklist: " << *C
728 for (SCC &MovedC : llvm::reverse(make_range(RC->begin() + InitialSCCIndex,
731 LLVM_DEBUG(dbgs() << "Enqueuing a newly earlier in post-order SCC: "
737 assert(!UR.InvalidatedSCCs.count(C) && "Invalidated the current SCC!");
739 assert(&C->getOuterRefSCC() == RC && "Current SCC not in current RefSCC!");
741 // Record the current RefSCC and SCC for higher layers of the CGSCC pass
751 LazyCallGraph::SCC &llvm::updateCGAndAnalysisManagerForFunctionPass(
752 LazyCallGraph &G, LazyCallGraph::SCC &InitialC, LazyCallGraph::Node &N,
758 LazyCallGraph::SCC &llvm::updateCGAndAnalysisManagerForCGSCCPass(
759 LazyCallGraph &G, LazyCallGraph::SCC &InitialC, LazyCallGraph::Node &N,