[lld] r182786 - [Driver] Parallelize reading initial object files.

Rui Ueyama ruiu at google.com
Tue May 28 13:21:33 PDT 2013


On Tue, May 28, 2013 at 12:21 PM, Nick Kledzik <kledzik at apple.com> wrote:

> On May 28, 2013, at 12:00 PM, Rui Ueyama <ruiu at google.com> wrote:
>
> +
>> +    tg.spawn([&, index] {
>> +      if (error_code ec = targetInfo.readFile(input.getPath(),
>> files[index])) {
>> +        diagnostics << "Failed to read file: " << input.getPath()
>> +                    << ": " << ec.message() << "\n";
>> +        fail = true;
>> +        return;
>> +      }
>> +    });
>> +    ++index;
>>
>
> It's coming back to the other thread, but if targetInfo needs to be
> updated during input file parsing, parallelizing this piece of code would
> result in unpredictable behavior. I'm not saying that we can't paralellize
> this but just don't have a good idea to deal with that.
>
>
> How fast can the linker options be extracted from the file?  If fast, then
> one model would be to make a serialized pass over the input files just to
> collect linker options and update target info, then the next pass would be
> the parallel parsing of the input files.
>

For COFF it should be pretty fast; linker options are in .drectve section
and extracting that section is easy. It's also true for the linker script
because linker scripts are usually small. So two pass would work. That does
not really resolve the point that we discussed in the another thread for
library use case and reusability of targetinfo, though.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130528/b90e4036/attachment.html>


More information about the llvm-commits mailing list