aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorYuxuan Chen <ych@fb.com>2024-07-10 22:22:45 -0700
committerGitHub <noreply@github.com>2024-07-10 22:22:45 -0700
commit0483f14b003cb3a2c0045d8f54523a2e9a266b0f (patch)
tree8000e0bccc0828f9efbb863c47d1a0e7eebc91ed /llvm/lib
parentdbd00a5968d6c823d686714c91f2b4fcfd03797a (diff)
downloadllvm-0483f14b003cb3a2c0045d8f54523a2e9a266b0f.zip
llvm-0483f14b003cb3a2c0045d8f54523a2e9a266b0f.tar.gz
llvm-0483f14b003cb3a2c0045d8f54523a2e9a266b0f.tar.bz2
[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.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Coroutines/CoroSplit.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
index 299b514..0b52d1e 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();
}