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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sun May 15 10:57:49 PDT 2016


ruiu 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.
----------------
davide wrote:
> 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.
Maybe your name is better. :) My point was just to split the function.


http://reviews.llvm.org/D20267





More information about the llvm-commits mailing list