OSDN Git Service

[PM] Add pgo-memop-opt pass to the new pass manager
authorRong Xu <xur@google.com>
Mon, 23 Oct 2017 22:21:29 +0000 (22:21 +0000)
committerRong Xu <xur@google.com>
Mon, 23 Oct 2017 22:21:29 +0000 (22:21 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316384 91177308-0d34-0410-b5e6-96231b3b80d8

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

index c6ec97b..219c383 100644 (file)
@@ -362,6 +362,12 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
 
   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());
 
index 4a9d124..5d6ed49 100644 (file)
@@ -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