[PATCH] D39145: [PM] Add pgo-memop-opt pass to the new pass manager

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 12:41:54 PDT 2017


xur updated this revision to Diff 119916.
xur added a comment.

Updated the patch with review comments.

@davidxl: I meant to use PGOOpt->SampleProfileFile.empty(), instead of !PGOOpt->SampleProfileFile.empty().
But !PGOOpt->ProfileUseFile.empty() is definitely better here.

@davide: Added the check in PGO use pipeline.

Thanks!


https://reviews.llvm.org/D39145

Files:
  lib/Passes/PassBuilder.cpp
  test/Other/new-pm-pgo.ll


Index: test/Other/new-pm-pgo.ll
===================================================================
--- test/Other/new-pm-pgo.ll
+++ test/Other/new-pm-pgo.ll
@@ -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
Index: lib/Passes/PassBuilder.cpp
===================================================================
--- lib/Passes/PassBuilder.cpp
+++ lib/Passes/PassBuilder.cpp
@@ -362,6 +362,10 @@
 
   invokePeepholeEPCallbacks(FPM, Level);
 
+  if (PGOOpt && !PGOOpt->ProfileUseFile.empty() &&
+      !isOptimizingForSize(Level))
+    FPM.addPass(PGOMemOPSizeOpt());
+
   FPM.addPass(TailCallElimPass());
   FPM.addPass(SimplifyCFGPass());
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39145.119916.patch
Type: text/x-patch
Size: 1023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171023/7bfd9a60/attachment.bin>


More information about the llvm-commits mailing list