summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/TargetParser.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-08-21 08:00:54 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-08-21 08:00:54 +0000
commitd7305ef06c02cbb2e20b2d4fa2d6d368ce4f641e (patch)
tree3abc72eca3ab5e87bb4086a130321dfc38934c58 /llvm/lib/Support/TargetParser.cpp
parent5d0ea70ad5212dfb4de138e1eedff4450eef19e4 (diff)
downloadbcm5719-llvm-d7305ef06c02cbb2e20b2d4fa2d6d368ce4f641e.tar.gz
bcm5719-llvm-d7305ef06c02cbb2e20b2d4fa2d6d368ce4f641e.zip
[Support/Parallel] - Do not use a task group for a very small task.
parallel_for_each_n splits a given task into small pieces of tasks and then passes them to background threads managed by a thread pool to process them in parallel. TaskGroup then waits for all tasks to be done, which is done by TaskGroup's destructor. In the previous code, all tasks were passed to background threads, and the main thread just waited for them to finish their jobs. This patch changes the logic so that the main thread processes a task just like other worker threads instead of just waiting for workers. This patch improves the performance of parallel_for_each_n for a task which is too small that we do not split it into multiple tasks. Previously, such task was submitted to another thread and the main thread waited for its completion. That involves multiple inter-thread synchronization which is not cheap for small tasks. Now, such task is processed by the main thread, so no inter-thread communication is necessary. Differential revision: https://reviews.llvm.org/D36607 llvm-svn: 311312
Diffstat (limited to 'llvm/lib/Support/TargetParser.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud