[llvm] 364cd76 - [NFC] Expose the -Oz module optimization pipeline to opt

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 09:29:14 PDT 2020


Author: Mircea Trofin
Date: 2020-08-20T09:28:58-07:00
New Revision: 364cd768a2764211ec0cbcf0c0bdbe4d8f4565b9

URL: https://github.com/llvm/llvm-project/commit/364cd768a2764211ec0cbcf0c0bdbe4d8f4565b9
DIFF: https://github.com/llvm/llvm-project/commit/364cd768a2764211ec0cbcf0c0bdbe4d8f4565b9.diff

LOG: [NFC] Expose the -Oz module optimization pipeline to opt

This exposes the module optimization pipeline as a pass that can be
applied stand-alone when using 'opt'. This helps ml inliner training
scenarios, where we start with IR captured right before inlining,
perform the inlining (-scc-oz-module-inliner) and then want to continue
and observe the final IR (where this patch comes into play). We can then
apply llc on the resulting IR to continue compilation down to native.

Differential Revision: https://reviews.llvm.org/D86224

Added: 
    

Modified: 
    llvm/lib/Passes/PassRegistry.def

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index e0d7a4b5b2d9..1176db872c59 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -85,6 +85,8 @@ MODULE_PASS("rpo-function-attrs", ReversePostOrderFunctionAttrsPass())
 MODULE_PASS("sample-profile", SampleProfileLoaderPass())
 MODULE_PASS("scc-oz-module-inliner",
   buildInlinerPipeline(OptimizationLevel::Oz, ThinLTOPhase::None, DebugLogging))
+MODULE_PASS("oz-module-optimizer",
+  buildModuleOptimizationPipeline(OptimizationLevel::Oz, DebugLogging, /*LTOPreLink*/false))
 MODULE_PASS("strip-dead-prototypes", StripDeadPrototypesPass())
 MODULE_PASS("synthetic-counts-propagation", SyntheticCountsPropagation())
 MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass(nullptr, nullptr))


        


More information about the llvm-commits mailing list