[PATCH] D72486: Add ThinLtoJIT example

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 22:43:14 PST 2020


lhames added inline comments.


================
Comment at: llvm/examples/ThinLtoJIT/ThinLtoJIT.cpp:258
+          CompileThreads->async([MU, &JD]() { MU->doMaterialize(JD); });
+        }
+      });
----------------
lhames wrote:
> sgraenitz wrote:
> > @lhames: It looks like the session lock is a major bottleneck and not dispatching "trivial" modules to threads seems to help reducing the pressure. Do you think that's reasonable?
> > 
> > Are MaterializationUnit types meant to be distinguishable by type? Would it benefit from `isa<>`/`cast<>` support?
> > 
> Yes! I ran in to the same problem when developing our demo for the 2018 developer’s meeting.
> 
> I posted https://reviews.llvm.org/D39111 as a solution to distinguishing MUs by type, but haven’t had time to land it yet. Maybe it’s time to start making some noise on that review again.
Side note: The bottle neck here may not be the session lock. I thought that was the culprit for our 2018 dev-meeting demo too, but it was really the thread pool: trivial materializes couldn’t get a thread to run on at all, rather than running but blocking on the session lock. Could that be what’s happening to you too?

Either way: I think I should add some logging to runSessionLocked to track how long threads spend holding the session lock, and how long they spend blocked waiting on it.


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