[llvm] [NFC][Coroutines] Remove redundant checks for replacing PrepareFns (PR #98392)

Yuxuan Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 22:05:00 PDT 2024


================
@@ -2108,12 +2108,6 @@ PreservedAnalyses CoroSplitPass::run(LazyCallGraph::SCC &C,
   if (Coroutines.empty() && PrepareFns.empty())
     return PreservedAnalyses::all();
 
-  if (Coroutines.empty()) {
----------------
yuxuanchen1997 wrote:

Oh sorry. I meant L2118 here. `for (LazyCallGraph::Node *N : Coroutines) {`

With and without this block, the executed logic is identical. With this block, this PrepareFns gets replaced with `replaceAllPrepares` on L2113. Without this block, if the Coroutines collection happens to be empty, it goes to the L2118 loop without any iteration, it goes to L2146 to perform the same logic. 

https://github.com/llvm/llvm-project/pull/98392


More information about the llvm-commits mailing list