[llvm] r316384 - [PM] Add pgo-memop-opt pass to the new pass manager
Rong Xu via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 23 15:21:29 PDT 2017
Author: xur
Date: Mon Oct 23 15:21:29 2017
New Revision: 316384
URL: http://llvm.org/viewvc/llvm-project?rev=316384&view=rev
Log:
[PM] Add pgo-memop-opt pass to the new pass manager
This pass adds pgo-memop-opt pass to the new pass manager.
It is in the old pass manager but somehow left out in the new pass manager.
Differential Revision: http://reviews.llvm.org/D39145
Modified:
llvm/trunk/lib/Passes/PassBuilder.cpp
llvm/trunk/test/Other/new-pm-pgo.ll
Modified: llvm/trunk/lib/Passes/PassBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassBuilder.cpp?rev=316384&r1=316383&r2=316384&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp (original)
+++ llvm/trunk/lib/Passes/PassBuilder.cpp Mon Oct 23 15:21:29 2017
@@ -362,6 +362,12 @@ PassBuilder::buildFunctionSimplification
invokePeepholeEPCallbacks(FPM, Level);
+ // For PGO use pipeline, try to optimize memory intrinsics such as memcpy
+ // using the size value profile. Don't perform this when optimizing for size.
+ if (PGOOpt && !PGOOpt->ProfileUseFile.empty() &&
+ !isOptimizingForSize(Level))
+ FPM.addPass(PGOMemOPSizeOpt());
+
FPM.addPass(TailCallElimPass());
FPM.addPass(SimplifyCFGPass());
Modified: llvm/trunk/test/Other/new-pm-pgo.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/new-pm-pgo.ll?rev=316384&r1=316383&r2=316384&view=diff
==============================================================================
--- llvm/trunk/test/Other/new-pm-pgo.ll (original)
+++ llvm/trunk/test/Other/new-pm-pgo.ll Mon Oct 23 15:21:29 2017
@@ -11,6 +11,8 @@
;
; GEN: Running pass: PGOInstrumentationGen
; USE: Running pass: PGOInstrumentationUse
+; USE: Running pass: PGOIndirectCallPromotion
+; USE: Running pass: PGOMemOPSizeOpt
; SAMPLE_USE_O: Running pass: ModuleToFunctionPassAdaptor<{{.*}}AddDiscriminatorsPass{{.*}}>
; SAMPLE_USE_PRE_LINK: Running pass: ModuleToFunctionPassAdaptor<{{.*}}AddDiscriminatorsPass{{.*}}>
; SAMPLE_USE: Running pass: SimplifyCFGPass
More information about the llvm-commits
mailing list