DescriptionSubzero: Initial implementation of multithreaded translation.
Provides a single-producer, multiple-consumer translation queue where the number of translation threads is given by the -threads=N argument. The producer (i.e., bitcode parser) blocks if the queue size is >=N, in order to control the memory footprint. If N=0 (which is the default), execution is purely single-threaded. If N=1, there is a single translation thread running in parallel with the parser thread. "make check" succeeds with the default changed to N=1.
Currently emission is also done by the translation thread, which limits scalability since the emit stream has to be locked. Also, since the ELF writer stream is not locked, it won't be safe to use N>1 with the ELF writer. Furthermore, for N>1, emitted function ordering is nondeterministic and needs to be recombobulated. This will all be fixed in a follow-on CL.
The -timing option is broken for N>0. This will be fixed in a follow-on CL.
Verbose flags are now managed in the Cfg instead of (or in addition to) the GlobalContext, due to the -verbose-focus option which wants to temporarily change the verbose level for a particular function.
TargetLowering::emitConstants() and related methods are changed to be static, so that a valid TargetLowering object isn't required. This is because the TargetLowering object wants to hold a valid Cfg, and none really exists after all functions are translated and the constant pool is ready for emission.
The Makefile.standalone now has a TSAN=1 option to enable ThreadSanitizer.
BUG= none
R=jfb@chromium.org
Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=fa4efea5413aa993e8e6ba10579e0934d1a3e784
Patch Set 1 #Patch Set 2 : Cleanup #
Total comments: 47
Patch Set 3 : Code review update #Patch Set 4 : Fix some work queue issues #Patch Set 5 : Fix getErrorStatus() usage in BitcodeMunger #
Total comments: 6
Patch Set 6 : Code review changes, continued #
Total comments: 10
Patch Set 7 : Better error code management. Move locked fields around. #Patch Set 8 : Make CfgQueue::Sequential logic more clear. Move IsEnded field. #
Total comments: 32
Patch Set 9 : Add a TSAN=1 make configuration #Patch Set 10 : Adjustments to CfgQueue #Patch Set 11 : clang-format #
Total comments: 10
Patch Set 12 : Enhance error codes. Use a circular buffer under the work queue. #
Total comments: 11
Patch Set 13 : Better circular buffer implementation. Comment changes. #Patch Set 14 : Rebase #
Messages
Total messages: 29 (1 generated)
|