[PATCH] D122275: [PassManager][Coroutine] Run passes under -O0 conditionally and run GlobalDCE

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 17:09:45 PDT 2022


aeubanks created this revision.
Herald added subscribers: ChuanqiXu, hiraditya, mgorny.
Herald added a project: All.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

CoroSplit lowers various coroutine intrinsics. It's a CGSCC pass and
CGSCC passes don't run on unreachable functions. Normally GlobalDCE will
come along and delete unreachable functions, but we don't run GlobalDCE
under -O0, so an unreachable function with coroutine intrinsics may
never have CoroSplit run on it.

This patch adds GlobalDCE when coroutines intrinsics are present. It
also now runs all coroutine passes conditional when coroutine intrinsics
are present. This solves the -O0 compile time regression reported in
D105877 <https://reviews.llvm.org/D105877> due to LazyCallGraph construction.

Fixes https://github.com/llvm/llvm-project/issues/54117


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122275

Files:
  llvm/include/llvm/Transforms/Coroutines/CoroConditionalWrapper.h
  llvm/lib/Passes/PassBuilderPipelines.cpp
  llvm/lib/Transforms/Coroutines/CMakeLists.txt
  llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp
  llvm/test/Other/new-pm-O0-defaults.ll
  llvm/test/Transforms/Coroutines/coro-internal-O0.ll
  llvm/test/Transforms/Coroutines/coro-retcon-once-private.ll
  llvm/test/Transforms/Coroutines/smoketest.ll
  llvm/utils/gn/secondary/llvm/lib/Transforms/Coroutines/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122275.417445.patch
Type: text/x-patch
Size: 7927 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220323/26b6d04c/attachment.bin>


More information about the llvm-commits mailing list