@@ -2080,13 +2080,12 @@ splitCoroutine(Function &F, SmallVectorImpl<Function *> &Clones,
2080
2080
return Shape;
2081
2081
}
2082
2082
2083
- static LazyCallGraph::SCC & updateCallGraphAfterCoroutineSplit (
2083
+ static void updateCallGraphAfterCoroutineSplit (
2084
2084
LazyCallGraph::Node &N, const coro::Shape &Shape,
2085
- const SmallVectorImpl<Function *> &Clones, LazyCallGraph::SCC &C,
2085
+ const SmallVectorImpl<Function *> &Clones, LazyCallGraph::SCC * &C,
2086
2086
LazyCallGraph &CG, CGSCCAnalysisManager &AM, CGSCCUpdateResult &UR,
2087
2087
FunctionAnalysisManager &FAM) {
2088
2088
2089
- auto *CurrentSCC = &C;
2090
2089
if (!Clones.empty ()) {
2091
2090
switch (Shape.ABI ) {
2092
2091
case coro::ABI::Switch:
@@ -2106,16 +2105,13 @@ static LazyCallGraph::SCC &updateCallGraphAfterCoroutineSplit(
2106
2105
}
2107
2106
2108
2107
// Let the CGSCC infra handle the changes to the original function.
2109
- CurrentSCC = &updateCGAndAnalysisManagerForCGSCCPass (CG, *CurrentSCC, N, AM,
2110
- UR, FAM);
2108
+ C = &updateCGAndAnalysisManagerForCGSCCPass (CG, *C, N, AM, UR, FAM);
2111
2109
}
2112
2110
2113
2111
// Do some cleanup and let the CGSCC infra see if we've cleaned up any edges
2114
2112
// to the split functions.
2115
2113
postSplitCleanup (N.getFunction ());
2116
- CurrentSCC = &updateCGAndAnalysisManagerForFunctionPass (CG, *CurrentSCC, N,
2117
- AM, UR, FAM);
2118
- return *CurrentSCC;
2114
+ C = &updateCGAndAnalysisManagerForFunctionPass (CG, *C, N, AM, UR, FAM);
2119
2115
}
2120
2116
2121
2117
// / Replace a call to llvm.coro.prepare.retcon.
@@ -2216,8 +2212,8 @@ PreservedAnalyses CoroSplitPass::run(LazyCallGraph::SCC &C,
2216
2212
coro::Shape Shape =
2217
2213
splitCoroutine (F, Clones, FAM.getResult <TargetIRAnalysis>(F),
2218
2214
OptimizeFrame, MaterializableCallback);
2219
- CurrentSCC = & updateCallGraphAfterCoroutineSplit (
2220
- *N, Shape, Clones, *CurrentSCC, CG, AM, UR, FAM);
2215
+ updateCallGraphAfterCoroutineSplit (*N, Shape, Clones, CurrentSCC, CG, AM,
2216
+ UR, FAM);
2221
2217
2222
2218
auto &ORE = FAM.getResult <OptimizationRemarkEmitterAnalysis>(F);
2223
2219
ORE.emit ([&]() {
0 commit comments