aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Lapshin <a.v.lapshin@mail.ru>2023-05-04 18:13:29 +0200
committerAlexey Lapshin <a.v.lapshin@mail.ru>2023-05-04 18:47:59 +0200
commit629177a8197599ae9957a936f17373ea411a5fa5 (patch)
tree3290b86cefecf1dd6da0cda13e2479afc9bd0738
parentc0e5e7db9ae27db765981f5e55e0819f369d7095 (diff)
downloadllvm-629177a8197599ae9957a936f17373ea411a5fa5.zip
llvm-629177a8197599ae9957a936f17373ea411a5fa5.tar.gz
llvm-629177a8197599ae9957a936f17373ea411a5fa5.tar.bz2
Fix test bot breakage from 06b617064a997574df409c7d846b6f6b492f5124
This addresses the issue found by: https://lab.llvm.org/buildbot#builders/178/builds/4571
-rw-r--r--llvm/lib/Support/Parallel.cpp4
-rw-r--r--llvm/unittests/Support/ParallelTest.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Support/Parallel.cpp b/llvm/lib/Support/Parallel.cpp
index 9c04af6..f544790 100644
--- a/llvm/lib/Support/Parallel.cpp
+++ b/llvm/lib/Support/Parallel.cpp
@@ -185,8 +185,12 @@ Executor *Executor::getDefaultExecutor() {
// lock, only allow the root TaskGroup to run tasks parallelly. In the scenario
// of nested parallel_for_each(), only the outermost one runs parallelly.
TaskGroup::TaskGroup()
+#if LLVM_ENABLE_THREADS
: Parallel((parallel::strategy.ThreadsRequested != 1) &&
(threadIndex == UINT_MAX)) {}
+#else
+ : Parallel(false) {}
+#endif
TaskGroup::~TaskGroup() {
// We must ensure that all the workloads have finished before decrementing the
// instances count.
diff --git a/llvm/unittests/Support/ParallelTest.cpp b/llvm/unittests/Support/ParallelTest.cpp
index 7afe650..53ef9fa 100644
--- a/llvm/unittests/Support/ParallelTest.cpp
+++ b/llvm/unittests/Support/ParallelTest.cpp
@@ -103,6 +103,7 @@ TEST(Parallel, TaskGroupSequentialFor) {
EXPECT_EQ(Count, 500ul);
}
+#if LLVM_ENABLE_THREADS
TEST(Parallel, NestedTaskGroup) {
// This test checks:
// 1. Root TaskGroup is in Parallel mode.
@@ -128,7 +129,6 @@ TEST(Parallel, NestedTaskGroup) {
});
}
-#if LLVM_ENABLE_THREADS
TEST(Parallel, ParallelNestedTaskGroup) {
// This test checks that it is possible to have several TaskGroups
// run from different threads in Parallel mode.