[PATCH] Run the resolver in parallel with the reader.

Rui Ueyama ruiu at google.com
Fri Jan 16 06:40:59 PST 2015


Ping.

On Thu, Jan 15, 2015 at 1:12 AM, Rui Ueyama <ruiu at google.com> wrote:

> Hi Bigcheese, kledzik, atanasyan, shankarke, Jean-Daniel,
>
> This patch makes File::parse() multi-thread safe. If one thread is running
> File::parse(), other threads will block if they try to call the same
> method.
> File::parse() is idempotent, so you can safely call  multiple times.
>
> With this change, we don't have to wait for all worker threads to finish
> in Driver::link(). Previously, Driver::link() calls TaskGroup::sync() to
> wait for all threads running File::parse(). This was not ideal because
> we couldn't start the resolver until we parse all files.
>
> This patch increase parallelism by making Driver::link() to not wait for
> worker threads. The resolver calls parse() to make sure that the file
> being read has been parsed, and then uses the file. In this approach,
> the resolver can run with the parser threads in parallel.
>
> (This patch also opens up a possibility to read files from archive files
> speculatively. Currently, reading member files from an archive file is
> pretty slow because it's serialized, since the resolver is a single-
> threaded routine. We could speed this thing up by instantiating member
> files that are likely to be needed. As long as a file instantiation and
> its parse() method are side-effect free, that operation does not affect
> correctness. I don't do that in this patch, but will try in future.)
>
> http://reviews.llvm.org/D6994
>
> Files:
>   include/lld/Core/File.h
>   include/lld/Core/LinkingContext.h
>   include/lld/Core/Resolver.h
>   lib/Core/File.cpp
>   lib/Core/Resolver.cpp
>   lib/Driver/Driver.cpp
>   lib/ReaderWriter/ELF/ELFFile.h
>   lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150116/96266532/attachment.html>


More information about the llvm-commits mailing list