[PATCH] D20267: [LTO] Add the ability to specify a subset of passes to run

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Sun May 15 10:56:18 PDT 2016


davide added inline comments.

================
Comment at: ELF/LTO.cpp:69-70
@@ -62,12 +68,4 @@
 static void runLTOPasses(Module &M, TargetMachine &TM) {
-  legacy::PassManager LtoPasses;
-  LtoPasses.add(createTargetTransformInfoWrapperPass(TM.getTargetIRAnalysis()));
-  PassManagerBuilder PMB;
-  PMB.LibraryInfo = new TargetLibraryInfoImpl(Triple(TM.getTargetTriple()));
-  PMB.Inliner = createFunctionInliningPass();
-  PMB.VerifyInput = PMB.VerifyOutput = !Config->DisableVerify;
-  PMB.LoopVectorize = true;
-  PMB.SLPVectorize = true;
-  PMB.OptLevel = Config->LtoO;
-  PMB.populateLTOPassManager(LtoPasses);
-  LtoPasses.run(M);
+
+  if (!Config->LtoNewPmPasses.empty()) {
+    // The user explicitly asked for a set of passes to be run.
----------------
ruiu wrote:
> Can you please split the function so that you can do
> 
>   if (!Config->LtoNewPmPasses.empty())
>     runNewLtoPasses(M, TM);
>   else
>     runOldLtoPasses(M, TM);
> 
I don't want to bikeshed, but.
The name `runNewLtoPasses` is misleading because it doesn't capture the fact that we're running a custom pipeline. `runNewLtoCustomPasses` would be more appropriate. Or whatever you want to suggest, I'll take.


http://reviews.llvm.org/D20267





More information about the llvm-commits mailing list