Skip to content

Commit d614027

Browse files
authored
[LTO][Pipeline][Coro] Add missing coro pass to O0 post-link thinlto pipeline (#159497)
Add missing coroutine passes so that coro code can be correctly compiled. Fix #155558
1 parent 0d92b7f commit d614027

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,6 +1831,7 @@ ModulePassManager PassBuilder::buildThinLTODefaultPipeline(
18311831
// in ICP.
18321832
MPM.addPass(LowerTypeTestsPass(nullptr, nullptr,
18331833
lowertypetests::DropTestKind::Assume));
1834+
MPM.addPass(buildCoroWrapper(ThinOrFullLTOPhase::ThinLTOPostLink));
18341835
// Drop available_externally and unreferenced globals. This is necessary
18351836
// with ThinLTO in order to avoid leaving undefined references to dead
18361837
// globals in the object file.

llvm/test/Other/new-pm-O0-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
; CHECK-PRE-LINK: Running pass: CanonicalizeAliasesPass
4545
; CHECK-PRE-LINK-NEXT: Running pass: NameAnonGlobalPass
4646
; CHECK-THINLTO: Running pass: LowerTypeTestsPass
47+
; CHECK-THINLTO-NEXT: Running pass: CoroConditionalWrapper
4748
; CHECK-THINLTO-NEXT: Running pass: EliminateAvailableExternallyPass
4849
; CHECK-THINLTO-NEXT: Running pass: GlobalDCEPass
4950
; CHECK-LTO: Running pass: CrossDSOCFIPass on [module]

0 commit comments

Comments
 (0)