[ThinLTOCodeGenerator] Avoid Rehash StringMap in ThreadPool
authorSteven Wu <stevenwu@apple.com>
Fri, 14 Sep 2018 19:38:21 +0000 (19:38 +0000)
committerSteven Wu <stevenwu@apple.com>
Fri, 14 Sep 2018 19:38:21 +0000 (19:38 +0000)
commitec53c89fde3aff5247cac753c84629d07507b418
treed3a18bb7b0e1433443975655c2a1fdac63477de4
parent5f6789ef6e40a52451dda715839f24b75dfadfc2
[ThinLTOCodeGenerator] Avoid Rehash StringMap in ThreadPool

Summary:
During threaded thinLTO, it is possible that the entry for current
module doesn't exist in StringMaps (like ExportLists, ResolvedODR,
etc.). Using operator[] might trigger a rehash for the StringMap, which
might happen on multiple threads at the same time.

rdar://problem/43846199

Reviewers: tejohnson, mehdi_amini, kromanova, pcc

Reviewed By: tejohnson

Subscribers: dang, inglorion, eraman, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D52049

llvm-svn: 342263
llvm/lib/LTO/ThinLTOCodeGenerator.cpp