diff options
author | Zachary Turner <zturner@google.com> | 2014-06-10 23:01:20 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2014-06-10 23:01:20 +0000 |
commit | f6054ca18c86eaa4c204672404a4b9d24cb5233c (patch) | |
tree | 402ec755c91d48d7023e6d14c7cd4f660835355d /llvm/lib/Support/Timer.cpp | |
parent | f63bc64df55c4a35e6b0edeae1396225be6a7ce9 (diff) | |
download | bcm5719-llvm-f6054ca18c86eaa4c204672404a4b9d24cb5233c.tar.gz bcm5719-llvm-f6054ca18c86eaa4c204672404a4b9d24cb5233c.zip |
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
Diffstat (limited to 'llvm/lib/Support/Timer.cpp')
-rw-r--r-- | llvm/lib/Support/Timer.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index 61465ae5e8b..cdab02b2fb7 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -84,14 +84,13 @@ static TimerGroup *getDefaultTimerGroup() { sys::MemoryFence(); if (tmp) return tmp; - llvm_acquire_global_lock(); + std::lock_guard<llvm::recursive_mutex> Lock(llvm::llvm_get_global_lock()); tmp = DefaultTimerGroup; if (!tmp) { tmp = new TimerGroup("Miscellaneous Ungrouped Timers"); sys::MemoryFence(); DefaultTimerGroup = tmp; } - llvm_release_global_lock(); return tmp; } |