This is an archive of the discontinued LLVM Phabricator instance.

[Coroutines][5/6] Add coroutine passes to pipeline
ClosedPublic

Authored by modocache on Dec 26 2019, 6:27 AM.

Details

Summary

Depends on https://reviews.llvm.org/D71901.

The fifth in a series of patches that ports the LLVM coroutines passes
to the new pass manager infrastructure.

The first 4 patches allow users to run coroutine passes by invoking, for
example opt -passes=coro-early. However, most of LLVM's tests for
coroutines use an option, opt -enable-coroutines, which adds all 4
coroutine passes to the appropriate legacy pass manager extension points.
This patch does the same, but using the new pass manager: when
coroutine features are enabled and the new pass manager is being used,
this adds the new-pass-manager-compliant coroutine passes to the pass
builder's pipeline.

This allows us to run all coroutine tests using the new pass manager
(besides those that use the coroutine retcon ABI used by the Swift
compiler, which is not yet supported in the new pass manager).

Diff Detail

Event Timeline

modocache created this revision.Dec 26 2019, 6:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 26 2019, 6:27 AM
wenlei added a subscriber: wenlei.Dec 30 2019, 12:38 PM
modocache updated this revision to Diff 236244.Jan 5 2020, 5:45 AM
modocache edited the summary of this revision. (Show Details)
modocache removed a subscriber: wenlei.

Small cleanup.

modocache updated this revision to Diff 245052.Feb 17 2020, 3:49 PM
modocache retitled this revision from [Coroutines][5/6] Support 'opt -passes=coroutines' to [Coroutines][5/6] Add coroutine passes to pipeline.
modocache edited the summary of this revision. (Show Details)

Updated to use a new approach: instead of a custom pipeline parser, '-enable-coroutines' now adds coroutine passes to the new pass manager's pass builder. Using this in conjunction with the 'default<O2>' pipeline parser, this patch can now run all coroutine tests in the LLVM test suite -- and they all pass.

wenlei accepted this revision.Feb 17 2020, 8:38 PM

LGTM. Thanks for fixing the coro cleanup issue with ThinLTO here.

This revision is now accepted and ready to land.Feb 17 2020, 8:38 PM
This revision was automatically updated to reflect the committed changes.