[PATCH] D20268: [wip] Resolution-based LTO API.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 9 13:35:10 PDT 2016


lhames added a subscriber: lhames.

================
Comment at: lib/CodeGen/LTOBackend.cpp:142-149
@@ +141,10 @@
+                  std::unique_ptr<Module> M) {
+  if (!opt(Conf, TheTriple, TheTarget, 0, *M, /*IsThinLto=*/false))
+    return false;
+
+  if (ParallelCodeGenParallelismLevel == 1)
+    return codegen(Conf, TheTriple, TheTarget, AddStream, 0, *M);
+  else
+    return splitCodeGen(Conf, TheTriple, TheTarget, AddStream,
+                        ParallelCodeGenParallelismLevel, std::move(M));
+}
----------------
Apologies if this is a naive question - I'm still wrapping my head around this patch, but could opt/codegen/splitCodeGen be std::functions on Config rather than being plain functions that introspect the Config object to build the pass pipelines? This might allow you to decouple some of the pipeline setup logic from the LTO interface. It may also allow you to remove some of the hooks: E.g. If the user is supplying 'codegen', they can just add any module inspection code to their custom implementation, rather than having to set up 'PreCodeGenModuleHook'.


http://reviews.llvm.org/D20268





More information about the llvm-commits mailing list