[PATCH] D72486: Add ThinLtoJIT example
Stefan Gränitz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 12 09:48:07 PST 2020
sgraenitz marked an inline comment as done.
sgraenitz added a comment.
In D72486#1814233 <https://reviews.llvm.org/D72486#1814233>, @lhames wrote:
> Hi Stefan. Thanks for posting this! I’m out on vacation this week, but looking forward to reviewing when I get back to the office next week.
Hi Lang, that would be great! Looking forward to your comments.
It does pass the 403.gcc test case now, but can't beat lli orc-lazy per-module yet in terms of real-time performance.
There is one particular thing that I have to work on and would like to hear your recommendations. Please see the inline comment.
================
Comment at: llvm/examples/ThinLtoJIT/ThinLtoJIT.cpp:100
+ "request for it was in progress. Reparsing!",
+ KV.first().data(), KV.second.front().data()));
+
----------------
I am struggling to find a solution for this: The discovery thread is about to add the required module, but it's waiting for the session lock in JITDylib::define(). As the lock is recursive, I can load it again and add it from here, but that's expensive and I cannot prevent the other one from getting into defineImpl() anymore! This causes a lot of duplicate symbol errors. They are not fatal, but add too much extra overhead.
I am currently working on parallel module parsing which makes this much more likely to happen. The only way I see so far is to change the design and avoid concurrent AddModule() calls. Would be possible, but I'd lose some speculation performance.
Happy about any suggestions. Thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72486/new/
https://reviews.llvm.org/D72486
More information about the llvm-commits
mailing list