[PATCH] D51497: [WIP][ORC][ThinLTO] Early ThinLTO-JIT prototype and basic tests for next-gen ORC APIs

Stefan Gränitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 6 11:44:40 PDT 2018


sgraenitz abandoned this revision.
sgraenitz added a comment.

Thanks for your input. For now I worked more on internals than on testing, but at least I managed to use `.ll` files instead of `.cpp`. It looks like TOT clang can produce `.ll` files with summaries, but can't yet read them back in. So I use llvm-as manually to create `.bc` files and read those in my unit tests. I will close this review in favour of https://reviews.llvm.org/D51744, where I use this approach.



================
Comment at: lib/ExecutionEngine/Orc/LLThinLTOJIT.cpp:154
+    if (AddedModule && RelatedModuleInfo.Dylib != DefiningModuleInfo.Dylib) {
+      DefiningModuleInfo.Dylib->addToSearchOrder(*RelatedModuleInfo.Dylib);
+    }
----------------
lhames wrote:
> sgraenitz wrote:
> > It's not currently possible to obtain the SearchOrder to check for existing entries. That's on purpose?
> There is no getSearchOrder() method as that would not be thread safe. You can use withSearchOrderDo:
> 
>   auto &NewJD = // Get dylib to add to search order.
>   JD.withSearchOrderDo(
>     [&](const JITDylibList &SearchOrder) {
>       // Search to see if NewJD is already in the search order, bail out if it is.
>       for (auto *E : SearchOrder)
>         if (E == &NewJD)
>           return;
>       // NewJD was not in the search order. Add it.
>       addToSearchOrder(NewJD);
>     });
> 
> If this add-without-duplication operation turns out to be common we could add a DiscardDuplicates argument to addToSearchOrder and use that instead. 
Sure right, I saw that earlier but didn't remember. Thanks!


Repository:
  rL LLVM

https://reviews.llvm.org/D51497





More information about the llvm-commits mailing list