summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2017-10-23 22:21:29 +0000
committerRong Xu <xur@google.com>2017-10-23 22:21:29 +0000
commite1f4245f8df65353efb59bb0a559c721ca3866d8 (patch)
treeda384d12ecc71b8359e4ac246a29ba2e83ca291d
parent321e54f72d40aecd51f5db9e6d26c8db307e49a8 (diff)
downloadbcm5719-llvm-e1f4245f8df65353efb59bb0a559c721ca3866d8.tar.gz
bcm5719-llvm-e1f4245f8df65353efb59bb0a559c721ca3866d8.zip
[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 llvm-svn: 316384
-rw-r--r--llvm/lib/Passes/PassBuilder.cpp6
-rw-r--r--llvm/test/Other/new-pm-pgo.ll2
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index c6ec97bdf6d..219c3835f47 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -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());
diff --git a/llvm/test/Other/new-pm-pgo.ll b/llvm/test/Other/new-pm-pgo.ll
index 4a9d12484cd..5d6ed490250 100644
--- a/llvm/test/Other/new-pm-pgo.ll
+++ b/llvm/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
OpenPOWER on IntegriCloud