From: Rong Xu Date: Mon, 23 Oct 2017 22:21:29 +0000 (+0000) Subject: [PM] Add pgo-memop-opt pass to the new pass manager X-Git-Tag: android-x86-7.1-r4~9413 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2a01593233e991ce1dedcdd5463de0bdd1d6ca29;p=android-x86%2Fexternal-llvm.git [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316384 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Passes/PassBuilder.cpp b/lib/Passes/PassBuilder.cpp index c6ec97bdf6d..219c3835f47 100644 --- a/lib/Passes/PassBuilder.cpp +++ b/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/test/Other/new-pm-pgo.ll b/test/Other/new-pm-pgo.ll index 4a9d12484cd..5d6ed490250 100644 --- a/test/Other/new-pm-pgo.ll +++ b/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