[llvm] r269588 - ThinLTOCodeGenerator: fix race condition found using TSAN

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 10:22:30 PDT 2016


Nice!
What exactly did you run under tsan?
Is this is something like "ninja check-foo" (check-thin-lto?), I'd like to
add this to our sanitizer bot.

On Sat, May 14, 2016 at 10:49 PM, Mehdi Amini via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: mehdi_amini
> Date: Sun May 15 00:49:47 2016
> New Revision: 269588
>
> URL: http://llvm.org/viewvc/llvm-project?rev=269588&view=rev
> Log:
> ThinLTOCodeGenerator: fix race condition found using TSAN
>
> From: Mehdi Amini <mehdi.amini at apple.com>
>
> Modified:
>     llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
>
> Modified: llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp?rev=269588&r1=269587&r2=269588&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp (original)
> +++ llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp Sun May 15 00:49:47 2016
> @@ -884,6 +884,11 @@ void ThinLTOCodeGenerator::run() {
>    auto GUIDPreservedSymbols =
>        computeGUIDPreservedSymbols(PreservedSymbols, TMBuilder.TheTriple);
>
> +  // Make sure that every module has an entry in the ExportLists to enable
> +  // threaded access to this map below
> +  for (auto &DefinedGVSummaries : ModuleToDefinedGVSummaries)
> +    ExportLists[DefinedGVSummaries.first()];
> +
>    // Parallel optimizer + codegen
>    {
>      ThreadPool Pool(ThreadCount);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160516/2cb8e349/attachment.html>


More information about the llvm-commits mailing list