1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-21 18:22:53 +01:00

[NewPM] Add missing LTO ArgPromotion pass

This is a followup to D96780 to add one more pass missing from the
NewPM LTO pipeline. The missing ArgPromotion run is inserted at
the same position as in the LegacyPM, resolving the already
present FIXME:
16086d47c0/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp (L1096-L1098)

The compile-time impact is minimal with ~0.1% geomean regression
on CTMark.

Differential Revision: https://reviews.llvm.org/D108866

(cherry picked from commit b28c3b9d9f4292d7779a0e2661d308f1230c6ecd)
This commit is contained in:
Nikita Popov 2021-08-28 12:25:58 +02:00 committed by Tom Stellard
parent 72d2352801
commit fda0edff63
2 changed files with 5 additions and 1 deletions

View File

@ -1784,9 +1784,12 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
MPM.addPass(GlobalOptPass()); MPM.addPass(GlobalOptPass());
// Garbage collect dead functions. // Garbage collect dead functions.
// FIXME: Add ArgumentPromotion pass after once it's ported.
MPM.addPass(GlobalDCEPass()); MPM.addPass(GlobalDCEPass());
// If we didn't decide to inline a function, check to see if we can
// transform it to pass arguments by value instead of by reference.
MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(ArgumentPromotionPass()));
FunctionPassManager FPM; FunctionPassManager FPM;
// The IPO Passes may leave cruft around. Clean up after them. // The IPO Passes may leave cruft around. Clean up after them.
FPM.addPass(InstCombinePass()); FPM.addPass(InstCombinePass());

View File

@ -73,6 +73,7 @@
; CHECK-O23SZ-NEXT: Running pass: InlinerPass ; CHECK-O23SZ-NEXT: Running pass: InlinerPass
; CHECK-O23SZ-NEXT: Running pass: GlobalOptPass ; CHECK-O23SZ-NEXT: Running pass: GlobalOptPass
; CHECK-O23SZ-NEXT: Running pass: GlobalDCEPass ; CHECK-O23SZ-NEXT: Running pass: GlobalDCEPass
; CHECK-O23SZ-NEXT: Running pass: ArgumentPromotionPass
; CHECK-O23SZ-NEXT: Running pass: InstCombinePass ; CHECK-O23SZ-NEXT: Running pass: InstCombinePass
; CHECK-EP-Peephole-NEXT: Running pass: NoOpFunctionPass ; CHECK-EP-Peephole-NEXT: Running pass: NoOpFunctionPass
; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass