[all-commits] [llvm/llvm-project] 761bf3: [LLVM][Coroutines] Switch CoroAnnotationElidePass ...

Yuxuan Chen via All-commits all-commits at lists.llvm.org
Mon Sep 9 18:58:01 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 761bf333e378b52614cf36cd5db2837d5e4e0ae4
      https://github.com/llvm/llvm-project/commit/761bf333e378b52614cf36cd5db2837d5e4e0ae4
  Author: Yuxuan Chen <ych at fb.com>
  Date:   2024-09-09 (Mon, 09 Sep 2024)

  Changed paths:
    M llvm/include/llvm/Transforms/Coroutines/CoroAnnotationElide.h
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Transforms/Coroutines/CoroAnnotationElide.cpp

  Log Message:
  -----------
  [LLVM][Coroutines] Switch CoroAnnotationElidePass to a FunctionPass (#107897)

After landing https://github.com/llvm/llvm-project/pull/99285 we found
that the call graph update was causing the following crash when
expensive checks are turned on
```
llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp:982: LazyCallGraph::SCC &updateCGAndAnalysisManagerForPass(LazyCallGraph &, LazyCallGraph::SCC &, LazyCallGraph::Node &, CGSCCAnalysisManager &, CGSCCUpdateResult &, FunctionAnalysisManager &, bool): Assertion `(RC == &TargetRC || RC->isAncestorOf(Targe
tRC)) && "New call edge is not trivial!"' failed.                                                                                                                                                                                                                                                                               
```
I have to admit I believe that the call graph update process I did for
that patch could be wrong.

After reading the code in `CGSCCToFunctionPassAdaptor`, I am convinced
that `CoroAnnotationElidePass` can be a FunctionPass and rely on the
adaptor to update the call graph for us, so long as we properly
invalidate the caller's analyses.

After this patch,
`llvm/test/Transforms/Coroutines/coro-transform-must-elide.ll` no longer
fails under expensive checks.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list