1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

26 Commits

Author SHA1 Message Date
Zachary Turner
7f9340d9e1 Revert "Remove support for runtime multi-threading."
This reverts revision r210600.

llvm-svn: 210603
2014-06-10 23:15:43 +00:00
Zachary Turner
e87a554529 Remove support for runtime multi-threading.
This patch removes the functions llvm_start_multithreaded() and
llvm_stop_multithreaded(), and changes llvm_is_multithreaded()
to return a constant value based on the value of the compile-time
definition LLVM_ENABLE_THREADS.

Previously, it was possible to have compile-time support for
threads on, and runtime support for threads off, in which case
certain mutexes were not allocated or ever acquired.  Now, if the
build is created with threads enabled, mutexes are always acquired.

A test before/after patch of compiling a very large TU showed no
noticeable performance impact of this change.

Reviewers: rnk

Differential Revision: http://reviews.llvm.org/D4076

llvm-svn: 210600
2014-06-10 23:01:20 +00:00
Craig Topper
ee78063a54 [C++11] Make use of 'nullptr' in the Support library.
llvm-svn: 205697
2014-04-07 04:17:22 +00:00
Benjamin Kramer
6748fa3a23 Revert "[C++11] Replace LLVM atomics with std::atomic."
Breaks the MSVC build.
DataStream.cpp(44): error C2552: 'llvm::Statistic::Value' : non-aggregates cannot be initialized with initializer list

llvm-svn: 202731
2014-03-03 18:02:34 +00:00
Benjamin Kramer
d55423bf4c [C++11] Replace LLVM atomics with std::atomic.
With C++11 we finally have a standardized way to specify atomic operations. Use
them to replace the existing custom implemention. Sadly the translation is not
entirely trivial as std::atomic allows more fine-grained control over the
atomicity. I tried to preserve the old semantics as well as possible.

Differential Revision: http://llvm-reviews.chandlerc.com/D2915

llvm-svn: 202730
2014-03-03 17:53:30 +00:00
Filip Pizlo
9a441082e4 Make PrettyStackTraceEntry use ManagedStatic for its ThreadLocal.
This was somewhat tricky because ~PrettyStackTraceEntry() may run after 
llvm_shutdown() has been called. This is rare and only happens for a common idiom 
used in the main() functions of command-line tools. This works around the idiom by 
skipping the stack clean-up if the PrettyStackTraceHead ManagedStatic is not 
constructed (i.e. llvm_shutdown() has been called).

llvm-svn: 190730
2013-09-13 22:59:47 +00:00
Nick Lewycky
53185e9016 Add support for tsan annotations (thread sanitizer, a valgrind-based tool).
These annotations are disabled entirely when either ENABLE_THREADS is off, or
building a release build. When enabled, they add calls to functions with no
statements to ManagedStatic's getters.

Use these annotations to inform tsan that the race used inside ManagedStatic
initialization is actually benign. Thanks to Kostya Serebryany for helping
write this patch!

llvm-svn: 144567
2011-11-14 20:50:16 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Owen Anderson
6c2af9f474 Remove dead code. ManagedCleanup is unused, and contained a serious bug in that
the provided cleanup function is never actually called.

llvm-svn: 113284
2010-09-07 20:53:39 +00:00
Alisdair Meredith
b74a1f546f Resolve undefined behaviour when ManagedStatic is instantiated with a fixed-length array type.
llvm-svn: 75149
2009-07-09 17:26:16 +00:00
Owen Anderson
64a3af667e Fences are expensive. Avoid doing them when we're not in multithreaded mode.
llvm-svn: 73777
2009-06-19 17:50:11 +00:00
Owen Anderson
a59f91c08d Move Threading.[h|cpp] from Support to System.
llvm-svn: 73707
2009-06-18 16:54:52 +00:00
Owen Anderson
b7cdd1a395 Split the thread-related APIs out into their own file, and add a few more
calls for convenience.

llvm-svn: 73512
2009-06-16 17:33:51 +00:00
Owen Anderson
4f6709ebd6 Have llvm_start_multithreaded return a bool indicating whether multithreaded
initialization succeeded or not, rather than just asserting.

llvm-svn: 72182
2009-05-20 21:03:06 +00:00
Owen Anderson
47460293cf Add llvm_start_multithreaded(), which starts up the LLVM internals in thread-safe mode. Provide double-check locking
initialization of ManagedStatic's when running in thread-safe mode.

llvm-svn: 72151
2009-05-20 00:39:20 +00:00
Owen Anderson
a5fc80c2c6 Back out the thread-safe ManagedStatic for now. Too many people have too many problems with it for the moment.
llvm-svn: 71931
2009-05-16 07:20:52 +00:00
Owen Anderson
f77567f7ac Factor out some common code, fix more typoes, and add a memory fence that might be needed.
llvm-svn: 71853
2009-05-15 08:22:07 +00:00
Owen Anderson
c69f0d9a11 Fix an unfortunate typo.
llvm-svn: 71852
2009-05-15 08:07:23 +00:00
Owen Anderson
7ded7b9a62 Now with working on Leopard!
llvm-svn: 71819
2009-05-15 00:01:40 +00:00
Owen Anderson
3451ee22e8 Make ManagedStatic threadsafe by using atomic operations.
llvm-svn: 71796
2009-05-14 21:26:50 +00:00
Misha Brukman
7ee4196e74 Removed trailing whitespace.
llvm-svn: 65196
2009-02-20 22:51:36 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Chris Lattner
08e1470365 add a way to register an arbitrary cleanup function.
llvm-svn: 34442
2007-02-20 06:08:37 +00:00
Chris Lattner
e5eb7d79d3 add helper method.
llvm-svn: 34155
2007-02-10 19:54:24 +00:00
Chris Lattner
30bf130327 add a helper to call llvm_shutdown()
llvm-svn: 32249
2006-12-06 01:01:14 +00:00
Chris Lattner
30da1ba0a2 new helper class to provide more explicit management of static ctor/dtors.
llvm-svn: 30638
2006-09-28 00:31:55 +00:00