This is an archive of the discontinued LLVM Phabricator instance.

[PassManager][Coroutine] Run passes under -O0 conditionally and run GlobalDCE
ClosedPublic

Authored by aeubanks on Mar 22 2022, 5:09 PM.

Details

Summary

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 should also solve the -O0 regression reported in
D105877 due to LazyCallGraph construction.

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

Diff Detail

Event Timeline

aeubanks created this revision.Mar 22 2022, 5:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2022, 5:09 PM
aeubanks requested review of this revision.Mar 22 2022, 5:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2022, 5:09 PM
aeubanks updated this revision to Diff 417446.Mar 22 2022, 5:14 PM

check all intrinsics

aeubanks edited the summary of this revision. (Show Details)Mar 22 2022, 5:16 PM
ChuanqiXu accepted this revision.Mar 22 2022, 7:17 PM

LGTM. Thanks!

llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp
11

Is this one redundant?

This revision is now accepted and ready to land.Mar 22 2022, 7:17 PM
aeubanks added inline comments.Mar 23 2022, 9:52 AM
llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp
11

it's needed for coro::declaresAnyIntrinsic

This revision was landed with ongoing or failed builds.Mar 23 2022, 11:03 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2022, 11:03 AM