mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
[ThinLTO][NewPM] Clean up dead code under -O0
We're running into undefined references using ThinLTO with -O0 on Windows/Chrome. This fixes that. This matches the legacy PM. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D97414
This commit is contained in:
parent
983b1c6735
commit
e057f4f89a
@ -1539,8 +1539,17 @@ ModulePassManager PassBuilder::buildThinLTODefaultPipeline(
|
||||
MPM.addPass(LowerTypeTestsPass(nullptr, ImportSummary));
|
||||
}
|
||||
|
||||
if (Level == OptimizationLevel::O0)
|
||||
if (Level == OptimizationLevel::O0) {
|
||||
// Run a second time to clean up any type tests left behind by WPD for use
|
||||
// in ICP.
|
||||
MPM.addPass(LowerTypeTestsPass(nullptr, nullptr, true));
|
||||
// Drop available_externally and unreferenced globals. This is necessary
|
||||
// with ThinLTO in order to avoid leaving undefined references to dead
|
||||
// globals in the object file.
|
||||
MPM.addPass(EliminateAvailableExternallyPass());
|
||||
MPM.addPass(GlobalDCEPass());
|
||||
return MPM;
|
||||
}
|
||||
|
||||
// Force any function attributes we want the rest of the pipeline to observe.
|
||||
MPM.addPass(ForceFunctionAttrsPass());
|
||||
|
@ -35,6 +35,9 @@
|
||||
; CHECK-PRE-LINK-NEXT: Running pass: CanonicalizeAliasesPass
|
||||
; CHECK-PRE-LINK-NEXT: Running pass: NameAnonGlobalPass
|
||||
; CHECK-THINLTO-NEXT: Running pass: Annotation2MetadataPass
|
||||
; CHECK-THINLTO-NEXT: Running pass: LowerTypeTestsPass
|
||||
; CHECK-THINLTO-NEXT: Running pass: EliminateAvailableExternallyPass
|
||||
; CHECK-THINLTO-NEXT: Running pass: GlobalDCEPass
|
||||
; CHECK-LTO-NEXT: Running pass: Annotation2MetadataPass
|
||||
; CHECK-LTO-NEXT: Running pass: WholeProgramDevirtPass
|
||||
; CHECK-LTO-NEXT: Running analysis: InnerAnalysisManagerProxy
|
||||
|
Loading…
Reference in New Issue
Block a user