[llvm] 629177a - Fix test bot breakage from 06b617064a997574df409c7d846b6f6b492f5124
Alexey Lapshin via llvm-commits
llvm-commits at lists.llvm.org
Thu May 4 09:50:07 PDT 2023
Author: Alexey Lapshin
Date: 2023-05-04T18:47:59+02:00
New Revision: 629177a8197599ae9957a936f17373ea411a5fa5
URL: https://github.com/llvm/llvm-project/commit/629177a8197599ae9957a936f17373ea411a5fa5
DIFF: https://github.com/llvm/llvm-project/commit/629177a8197599ae9957a936f17373ea411a5fa5.diff
LOG: Fix test bot breakage from 06b617064a997574df409c7d846b6f6b492f5124
This addresses the issue found by: https://lab.llvm.org/buildbot#builders/178/builds/4571
Added:
Modified:
llvm/lib/Support/Parallel.cpp
llvm/unittests/Support/ParallelTest.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/Parallel.cpp b/llvm/lib/Support/Parallel.cpp
index 9c04af6ba3a0..f54479069cf6 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 7afe6501aaa8..53ef9fa25e82 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
diff erent threads in Parallel mode.
More information about the llvm-commits
mailing list