Skip to content

Commit 0483f14

Browse files
[NFC][Coroutines] Remove redundant checks for replacing PrepareFns (#98392)
If `Coroutines.empty()` the following loop is going to be skipped entirely and same goes for `PrepareFns.empty()`. These two conditions here aren't useful and adds to complexity.
1 parent dbd00a5 commit 0483f14

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

llvm/lib/Transforms/Coroutines/CoroSplit.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,12 +2108,6 @@ PreservedAnalyses CoroSplitPass::run(LazyCallGraph::SCC &C,
21082108
if (Coroutines.empty() && PrepareFns.empty())
21092109
return PreservedAnalyses::all();
21102110

2111-
if (Coroutines.empty()) {
2112-
for (auto *PrepareFn : PrepareFns) {
2113-
replaceAllPrepares(PrepareFn, CG, C);
2114-
}
2115-
}
2116-
21172111
// Split all the coroutines.
21182112
for (LazyCallGraph::Node *N : Coroutines) {
21192113
Function &F = N->getFunction();
@@ -2143,11 +2137,9 @@ PreservedAnalyses CoroSplitPass::run(LazyCallGraph::SCC &C,
21432137
}
21442138
}
21452139

2146-
if (!PrepareFns.empty()) {
21472140
for (auto *PrepareFn : PrepareFns) {
21482141
replaceAllPrepares(PrepareFn, CG, C);
21492142
}
2150-
}
21512143

21522144
return PreservedAnalyses::none();
21532145
}

0 commit comments

Comments
 (0)