[PATCH] D15024: [ThinLTO] Support for specifying function index from pass manager

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 3 12:11:10 PST 2015


tejohnson added inline comments.

================
Comment at: include/llvm/IR/Module.h:177
@@ -175,2 +176,3 @@
   DataLayout DL;                  ///< DataLayout associated with the module
+  std::unique_ptr<FunctionInfoIndex> FunctionIndex;
 
----------------
tejohnson wrote:
> joker.eph wrote:
> > It does not make sense to me conceptually: the FunctionIndex is not owned by a Module. It is a common data-structure for all Modules that we're dealing with.
> Ok, I had been thinking that this would be owned by the module we are importing into. But agree after thinking about the case you mentioned where there is one copy in memory in the linker, shared by all the backend threads.
> 
> Probably I should just pass the in-memory index directly in PassManagerBuilder. But the question is how to set this from clang (in D15025). The CodeGenOptions where I save the index file name doesn't seem like the right place, but perhaps I can save it on the CompilerInvocation object, and set it on the PassManagerBuilder from there. WDYT?
In the new patch I will upload it is passed on the PassManagerBuilder. The FE doesn't need to stash it anywhere it turns out, it is straightforward to pass it down to where I needed it.


http://reviews.llvm.org/D15024





More information about the llvm-commits mailing list