diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp index 299b514d34f1c..0b52d1e4490cb 100644 --- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp @@ -2108,12 +2108,6 @@ PreservedAnalyses CoroSplitPass::run(LazyCallGraph::SCC &C, if (Coroutines.empty() && PrepareFns.empty()) return PreservedAnalyses::all(); - if (Coroutines.empty()) { - for (auto *PrepareFn : PrepareFns) { - replaceAllPrepares(PrepareFn, CG, C); - } - } - // Split all the coroutines. for (LazyCallGraph::Node *N : Coroutines) { Function &F = N->getFunction(); @@ -2143,11 +2137,9 @@ PreservedAnalyses CoroSplitPass::run(LazyCallGraph::SCC &C, } } - if (!PrepareFns.empty()) { for (auto *PrepareFn : PrepareFns) { replaceAllPrepares(PrepareFn, CG, C); } - } return PreservedAnalyses::none(); }