1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/tools
Lang Hames a6587cc70d [ORC] Change the locking scheme for ThreadSafeModule.
ThreadSafeModule/ThreadSafeContext are used to manage lifetimes and locking
for LLVMContexts in ORCv2. Prior to this patch contexts were locked as soon
as an associated Module was emitted (to be compiled and linked), and were not
unlocked until the emit call returned. This could lead to deadlocks if
interdependent modules that shared contexts were compiled on different threads:
when, during emission of the first module, the dependence was discovered the
second module (which would provide the required symbol) could not be emitted as
the thread emitting the first module still held the lock.

This patch eliminates this possibility by moving to a finer-grained locking
scheme. Each client holds the module lock only while they are actively operating
on it. To make this finer grained locking simpler/safer to implement this patch
removes the explicit lock method, 'getContextLock', from ThreadSafeModule and
replaces it with a new method, 'withModuleDo', that implicitly locks the context,
calls a user-supplied function object to operate on the Module, then implicitly
unlocks the context before returning the result.

ThreadSafeModule TSM = getModule(...);
size_t NumFunctions = TSM.withModuleDo(
    [](Module &M) { // <- context locked before entry to lambda.
      return M.size();
    });

Existing ORCv2 layers that operate on ThreadSafeModules are updated to use the
new method.

This method is used to introduce Module locking into each of the existing
layers.

llvm-svn: 367686
2019-08-02 15:21:37 +00:00
..
bugpoint [Bugpoint] fix another use-after-move. NFC 2019-05-31 21:36:21 +00:00
bugpoint-passes Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
dsymutil [dsymutil] Fix heap-use-after-free related to the LinkOptions. 2019-08-01 23:37:33 +00:00
gold Fix gold-plugin Windows build 2019-07-23 07:41:17 +00:00
llc [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +00:00
lli [ORC] Change the locking scheme for ThreadSafeModule. 2019-08-02 15:21:37 +00:00
llvm-ar [llvm-ar] Document response file support in --help 2019-06-28 18:48:05 +00:00
llvm-as Make llvm-as --help great again 2019-05-27 08:24:06 +00:00
llvm-as-fuzzer Fix some include order and file headers issues. NFC 2019-02-21 07:42:31 +00:00
llvm-bcanalyzer [llvm-bcanalyzer] Refactor and move to libLLVMBitReader 2019-07-08 02:06:34 +00:00
llvm-c-test llvm-c-test avoid calling malloc(0) 2019-07-04 14:36:34 +00:00
llvm-cat Simplify llvm-cat help 2019-05-13 11:29:25 +00:00
llvm-cfi-verify Revert "[llvm-objdump] Add warning messages if disassembly + source for problematic inputs" 2019-07-30 07:05:27 +00:00
llvm-config Re-commit: r366610 and r366612: Expand pseudo-components before embedding in llvm-config 2019-07-19 22:46:47 +00:00
llvm-cov Revert r367649: Improve raw_ostream so that you can "write" colors using operator<< 2019-08-02 07:22:34 +00:00
llvm-cvtres Share /machine: handling code with llvm-cvtres too 2019-06-12 11:32:43 +00:00
llvm-cxxdump Break false dependencies on target libraries 2019-05-23 23:02:56 +00:00
llvm-cxxfilt [binutils] Add response file option to help and docs 2019-06-21 11:49:20 +00:00
llvm-cxxmap Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-diff Fix some include order and file headers issues. NFC 2019-02-21 07:42:31 +00:00
llvm-dis Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-dwarfdump Reland "[DwarfDebug] Dump call site debug info" 2019-07-31 16:51:28 +00:00
llvm-dwp Fix BUILD_SHARED_LIBS builds after r361567 2019-05-24 02:15:27 +00:00
llvm-elfabi Fix some include order and file headers issues. NFC 2019-02-21 07:42:31 +00:00
llvm-exegesis fix a typo unavaliable=>unavailable 2019-06-08 15:07:55 +00:00
llvm-extract Sanitize llvm-extract -help output 2019-06-12 21:08:19 +00:00
llvm-go [tests][go]Add -stdlib=libc++ to build GO test if LLVM is built with libc++ 2019-05-16 13:32:55 +00:00
llvm-isel-fuzzer Break a couple more false dependencies on target libraries 2019-06-10 23:52:38 +00:00
llvm-itanium-demangle-fuzzer Fix file header issues in fuzzers. NFC 2019-02-21 07:57:14 +00:00
llvm-jitlink [JITLink][ORC] Add EHFrameRegistrar interface, use in EHFrameRegistrationPlugin. 2019-07-04 00:05:12 +00:00
llvm-jitlistener Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-link Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-lipo [build] Add the ability to create a symlink for lipo 2019-07-31 16:46:57 +00:00
llvm-lto [ThinLTO]LTO]Legacy] Fix dependent libraries support by adding querying of the IRSymtab 2019-06-12 11:07:56 +00:00
llvm-lto2 [ThinLTO] Implement index-based WPD 2019-08-02 13:10:52 +00:00
llvm-mc [MC] Delete unused MCInstPrinter::markup overload and getPrintHexStyle 2019-07-25 09:54:12 +00:00
llvm-mc-assemble-fuzzer Fix some include order and file headers issues. NFC 2019-02-21 07:42:31 +00:00
llvm-mc-disassemble-fuzzer Fix file header issues in fuzzers. NFC 2019-02-21 07:57:14 +00:00
llvm-mca [MCA] Add support for printing immedate values as hex. Also enable lexing of masm binary and hex literals. 2019-08-02 10:38:25 +00:00
llvm-microsoft-demangle-fuzzer Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-modextract Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-mt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-nm Revert [tools] [llvm-nm] Default to reading from stdin not a.out 2019-07-16 15:33:43 +00:00
llvm-objcopy [llvm-objcopy] Improve --add-section argument string parsing 2019-07-29 16:22:40 +00:00
llvm-objdump [llvm-objdump] Fix jumptable detection when disassembling Mach-O binaries 2019-08-01 15:51:14 +00:00
llvm-opt-fuzzer Break a couple more false dependencies on target libraries 2019-06-10 23:52:38 +00:00
llvm-opt-report [Remarks][NFC] Rename remarks::Parser to remarks::RemarkParser 2019-07-25 00:16:56 +00:00
llvm-pdbutil llvm-pdbdump: Fix several smaller issues with injected source compression handling 2019-07-17 22:59:52 +00:00
llvm-profdata llvm-profdata] Handle the cases of overlapping input file and output file 2019-07-08 21:03:12 +00:00
llvm-rc Fix typos: (re)?sor?uce -> (re)?source 2019-04-26 05:56:23 +00:00
llvm-readobj [llvm-readelf] - A fix for: "--hash-symbols asserts for 64-bit ELFs" 2019-07-19 10:15:03 +00:00
llvm-rtdyld Break false dependencies on target libraries 2019-05-23 23:02:56 +00:00
llvm-shlib cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros 2019-07-12 14:40:18 +00:00
llvm-size [binutils] Add response file option to help and docs 2019-06-21 11:49:20 +00:00
llvm-special-case-list-fuzzer Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-split Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-stress Avoid cppcheck operator precedence warnings. NFCI. 2019-05-03 13:50:38 +00:00
llvm-strings [binutils] Add response file option to help and docs 2019-06-21 11:49:20 +00:00
llvm-symbolizer llvm-symbolizer: Add a FRAME command. 2019-06-24 20:03:23 +00:00
llvm-undname llvm-undname: Add a -raw-file flag to pass a raw buffer to microsoftDemangle 2019-04-16 12:51:40 +00:00
llvm-xray Revert "[llvm-objdump] Add warning messages if disassembly + source for problematic inputs" 2019-07-30 07:05:27 +00:00
llvm-yaml-numeric-parser-fuzzer Fix file header issues in fuzzers. NFC 2019-02-21 07:57:14 +00:00
lto cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros 2019-07-12 14:40:18 +00:00
msbuild vs integration: bump version nbr 2019-06-19 07:39:53 +00:00
obj2yaml [obj2yaml] - Report a error when unable to resolve a sh_link reference properly. 2019-07-29 07:58:29 +00:00
opt Revert "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline." 2019-06-26 12:13:13 +00:00
opt-viewer [opt-viewer] Teach optrecord.py about !Failure tags 2019-03-27 18:35:04 +00:00
remarks-shlib [Remarks] Simplify and refactor the RemarkParser interface 2019-07-16 15:25:05 +00:00
sancov [sancov] Ignore PC samples with value 0 2019-07-11 22:59:23 +00:00
sanstats [DebugInfo] add SectionedAddress to DebugInfo interfaces. 2019-02-27 13:17:36 +00:00
verify-uselistorder Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xcode-toolchain [CMake] Use LLVM_ENABLE_IDE instead of CMAKE_CONFIGURATION_TYPES 2018-10-15 21:20:02 +00:00
yaml2obj Recommit "rL366894: [yaml2obj] - Allow custom fields for the SHT_UNDEF sections." 2019-07-25 10:19:23 +00:00
CMakeLists.txt Fix most of LLVM's tests with LLVM_ENABLE_PIC=OFF 2019-01-16 20:44:36 +00:00
LLVMBuild.txt [JITLink] Add llvm-jitlink subdirectory to tools/LLVMBuild.txt 2019-04-20 17:58:29 +00:00