diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-10-10 18:57:23 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-10-10 18:57:23 +0000 |
commit | d49600320598a2b4e998e99f714c2e19d95197e8 (patch) | |
tree | 54e865120a81c3ce29e414fab18ab84c7a573638 /llvm/lib/Support/Parallel.cpp | |
parent | 13bd3ef40d8b1586f26a022e01b21e56c91e05bd (diff) | |
download | llvm-d49600320598a2b4e998e99f714c2e19d95197e8.zip llvm-d49600320598a2b4e998e99f714c2e19d95197e8.tar.gz llvm-d49600320598a2b4e998e99f714c2e19d95197e8.tar.bz2 |
win: Move Parallel.h off concrt to cross-platform code
r179397 added Parallel.h and implemented it terms of concrt in 2013.
In 2015, a cross-platform implementation of the functions has appeared
and is in use everywhere but on Windows (r232419). r246219 hints that
<thread> had issues in MSVC2013, but r296906 suggests they've been fixed
now that we require 2015+.
So remove the concrt code. It's less code, and it sounds like concrt has
conceptual and performance issues, see PR41198.
I built blink_core.dll in a debug component build with full symbols and
in a release component build without any symbols. I couldn't measure a
performance difference for linking blink_core.dll before and after this
patch.
Differential Revision: https://reviews.llvm.org/D68820
llvm-svn: 374421
Diffstat (limited to 'llvm/lib/Support/Parallel.cpp')
-rw-r--r-- | llvm/lib/Support/Parallel.cpp | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/llvm/lib/Support/Parallel.cpp b/llvm/lib/Support/Parallel.cpp index 621bccb..355c64b 100644 --- a/llvm/lib/Support/Parallel.cpp +++ b/llvm/lib/Support/Parallel.cpp @@ -32,34 +32,6 @@ public: static Executor *getDefaultExecutor(); }; -#if defined(_MSC_VER) -/// An Executor that runs tasks via ConcRT. -class ConcRTExecutor : public Executor { - struct Taskish { - Taskish(std::function<void()> Task) : Task(Task) {} - - std::function<void()> Task; - - static void run(void *P) { - Taskish *Self = static_cast<Taskish *>(P); - Self->Task(); - concurrency::Free(Self); - } - }; - -public: - virtual void add(std::function<void()> F) { - Concurrency::CurrentScheduler::ScheduleTask( - Taskish::run, new (concurrency::Alloc(sizeof(Taskish))) Taskish(F)); - } -}; - -Executor *Executor::getDefaultExecutor() { - static ConcRTExecutor exec; - return &exec; -} - -#else /// An implementation of an Executor that runs closures on a thread pool /// in filo order. class ThreadPoolExecutor : public Executor { @@ -117,8 +89,7 @@ Executor *Executor::getDefaultExecutor() { static ThreadPoolExecutor exec; return &exec; } -#endif -} +} // namespace static std::atomic<int> TaskGroupInstances; |