From f6054ca18c86eaa4c204672404a4b9d24cb5233c Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Tue, 10 Jun 2014 23:01:20 +0000 Subject: 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 --- llvm/lib/Support/Timer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Support/Timer.cpp') 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 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; } -- cgit v1.2.3