[llvm] [Coroutines][LazyCallGraph] resumes are not really SCC (PR #116285)
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 29 14:13:14 PST 2025
================
@@ -1082,11 +1082,14 @@ class LazyCallGraph {
/// Add new ref-recursive functions split/outlined from an existing function.
///
/// The new functions may only reference other functions that the original
- /// function did. The new functions may reference (not call) the original
- /// function.
+ /// function did. The new functions may reference the original function. New
+ /// functions must not call other new functions or the original function.
///
- /// The original function must reference (not call) all new functions.
- /// All new functions must reference (not call) each other.
+ /// Marks the original function as referencing all new functions.
+ ///
+ /// The CG must be updated following the use of this helper, for example with
+ /// updateCGAndAnalysisManagerForCGSCCPass(), to ensure the RefSCCs and SCCs
+ /// are correctly identified.
----------------
aeubanks wrote:
this comment isn't really true. if all you do is create new functions and add ref edges from the original function to the new functions, you technically don't need to call `updateCGAndAnalysisManagerForCGSCCPass()` since `addSplitRefRecursiveFunctions()` will take care of all the call graph updates, and (I believe) there are no analysis manager updates to be done. the point of `updateCGAndAnalysisManagerForCGSCCPass()` is to do the call graph update for you when there are potential edge additions/removals that can change the call graph and requeue any modified SCCs to be visited again. but if the pass does a limited number of transformations that can be expressed as LazyCallGraph API calls, doesn't do anything that would invalidate analysis manager results, and requeues any potentially modified SCCs (like the CoroSplit code that does that I mentioned above), then `updateCGAndAnalysisManagerForCGSCCPass()` is unnecessary.
so I'd remove this paragraph
https://github.com/llvm/llvm-project/pull/116285
More information about the llvm-commits
mailing list