github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h --
openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_mixed_capture_taskloop.cpp
openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_nontrivial_type_recursive_taskloop.cpp
openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_nontrivial_type_taskloop.cpp
openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_pointer_recursive_frameid_taskloop.cpp
openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_pointer_taskloop.cpp
openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_recursive_taskloop.cpp
openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_works_taskloop.cpp
openmp/runtime/test/taskgraph/taskgraph_replayable_nonlexical_shared_fails_1_taskloop.cpp
openmp/runtime/test/taskgraph/taskgraph_replayable_nonlexical_shared_fails_2_taskloop.cpp
openmp/runtime/test/taskgraph/taskgraph_replayable_saved_stack_depth_taskloop.cpp
clang/lib/CodeGen/CGOpenMPRuntime.cpp openmp/runtime/src/kmp.h
openmp/runtime/src/kmp_tasking.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index ee8583a9f..efafd0c80 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -5221,10 +5221,10 @@ void CGOpenMPRuntime::emitTaskLoopCall(
const auto *CS = cast<CapturedStmt>(D.getAssociatedStmt());
llvm::Function *RelocFn =
emitTaskRelocationFunction(CGM, Loc, *CS, CGF.CapturedStmtInfo, Data);
- TGTaskLoopArgs[13] = RelocFn
- ? CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(
- RelocFn, CGM.VoidPtrTy)
- : llvm::ConstantPointerNull::get(CGF.VoidPtrTy);
+ TGTaskLoopArgs[13] =
+ RelocFn ? CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(RelocFn,
+
CGM.VoidPtrTy)
+ : llvm::ConstantPointerNull::get(CGF.VoidPtrTy);
CGF.EmitRuntimeCall(OMPBuilder.getOrCreateRuntimeFunction(
CGM.getModule(), OMPRTL___kmpc_taskgraph_taskloop),
TGTaskLoopArgs);
diff --git a/openmp/runtime/src/kmp_tasking.cpp
b/openmp/runtime/src/kmp_tasking.cpp
index 7b3f4b04f..ba976bf07 100644
--- a/openmp/runtime/src/kmp_tasking.cpp
+++ b/openmp/runtime/src/kmp_tasking.cpp
@@ -6122,14 +6122,11 @@ void __kmpc_taskgraph_taskwait(ident_t *loc_ref,
kmp_int32 gtid,
has_no_wait);
}
-kmp_uint32 __kmpc_taskgraph_taskloop(ident_t *loc_ref, kmp_int32 gtid,
- kmp_task_t *new_task, kmp_int32 flags,
- kmp_int32 if_val, kmp_uint64 *lb,
- kmp_uint64 *ub, kmp_int64 st,
- kmp_int32 nogroup, kmp_int32 sched,
- kmp_uint64 grainsize, kmp_int32 modifier,
- void *task_dup,
- kmp_task_relocate_t relocate) {
+kmp_uint32 __kmpc_taskgraph_taskloop(
+ ident_t *loc_ref, kmp_int32 gtid, kmp_task_t *new_task, kmp_int32 flags,
+ kmp_int32 if_val, kmp_uint64 *lb, kmp_uint64 *ub, kmp_int64 st,
+ kmp_int32 nogroup, kmp_int32 sched, kmp_uint64 grainsize,
+ kmp_int32 modifier, void *task_dup, kmp_task_relocate_t relocate) {
kmp_info_t *thread = __kmp_threads[gtid];
kmp_taskgroup_t *taskgroup = thread->th.th_current_task->td_taskgroup;
kmp_taskgraph_record_t *rec = __kmp_taskgraph_or_parent_recording(taskgroup);
diff --git
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_mixed_capture_taskloop.cpp
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_mixed_capture_taskloop.cpp
index a6b473069..147e768dc 100644
---
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_mixed_capture_taskloop.cpp
+++
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_mixed_capture_taskloop.cpp
@@ -14,7 +14,8 @@ __attribute__((noinline)) static int
run_taskgraph_mixed_capture(int seed) {
#pragma omp taskgraph graph_id(612)
{
-#pragma omp taskloop replayable num_tasks(8) shared(x, y) firstprivate(fp)
reduction(+ : res)
+#pragma omp taskloop replayable num_tasks(8) shared(x, y) firstprivate(fp)
\
+ reduction(+ : res)
for (int i = 0; i < 16; ++i) {
res += x + y + fp + i;
}
@@ -29,14 +30,15 @@ int main() {
if (first != 280 || second != 5032) {
std::fprintf(stderr,
- "FAIL lexical mixed capture taskloop replay first=%d
second=%d expected=280/5032\n",
+ "FAIL lexical mixed capture taskloop replay first=%d "
+ "second=%d expected=280/5032\n",
first, second);
return 1;
}
- std::fprintf(stderr,
- "PASS lexical mixed capture taskloop replay first=%d
second=%d\n",
- first, second);
+ std::fprintf(
+ stderr, "PASS lexical mixed capture taskloop replay first=%d
second=%d\n",
+ first, second);
return 0;
}
diff --git
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_nontrivial_type_recursive_taskloop.cpp
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_nontrivial_type_recursive_taskloop.cpp
index 5adb743c5..ab23adf6c 100644
---
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_nontrivial_type_recursive_taskloop.cpp
+++
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_nontrivial_type_recursive_taskloop.cpp
@@ -29,15 +29,16 @@ __attribute__((noinline)) static int expected_recursive(int
depth, int seed,
return local + expected_recursive(depth - 1, seed + 9, run_tag);
}
-__attribute__((noinline)) static int run_recursive_nontrivial(int depth, int
seed,
- int run_tag) {
+__attribute__((noinline)) static int
+run_recursive_nontrivial(int depth, int seed, int run_tag) {
Tracker Obj(seed);
int res = 0;
int gid = 620 + depth;
#pragma omp taskgraph graph_id(gid)
{
-#pragma omp taskloop replayable num_tasks(8) shared(Obj, depth, run_tag)
reduction(+ : res)
+#pragma omp taskloop replayable num_tasks(8) shared(Obj, depth, run_tag)
\
+ reduction(+ : res)
for (int i = 0; i < 16; ++i) {
res += Obj.Value + (depth + 1) * 5 + run_tag + i;
}
@@ -59,9 +60,10 @@ int main() {
const int expected = expected_recursive(depth, seed, run);
if (actual != expected) {
- std::fprintf(stderr,
- "FAIL recursive nontrivial taskloop run=%d actual=%d
expected=%d\n",
- run, actual, expected);
+ std::fprintf(
+ stderr,
+ "FAIL recursive nontrivial taskloop run=%d actual=%d expected=%d\n",
+ run, actual, expected);
return 1;
}
@@ -71,13 +73,15 @@ int main() {
if (Tracker::Ctors != Tracker::Dtors || Tracker::Ctors < 12) {
std::fprintf(stderr,
- "FAIL recursive nontrivial taskloop lifetime ctors=%d
dtors=%d total=%d expected=%d\n",
+ "FAIL recursive nontrivial taskloop lifetime ctors=%d "
+ "dtors=%d total=%d expected=%d\n",
Tracker::Ctors, Tracker::Dtors, total_actual, total_expected);
return 1;
}
std::fprintf(stderr,
- "PASS recursive nontrivial taskloop total=%d expected=%d
ctors=%d dtors=%d\n",
+ "PASS recursive nontrivial taskloop total=%d expected=%d "
+ "ctors=%d dtors=%d\n",
total_actual, total_expected, Tracker::Ctors, Tracker::Dtors);
return 0;
}
diff --git
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_nontrivial_type_taskloop.cpp
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_nontrivial_type_taskloop.cpp
index df846e80e..9d4d3dd15 100644
---
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_nontrivial_type_taskloop.cpp
+++
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_nontrivial_type_taskloop.cpp
@@ -43,13 +43,15 @@ int main() {
if (first != 136 || second != 1720 || Tracker::Ctors < 2 ||
Tracker::Dtors < 2 || Tracker::Ctors != Tracker::Dtors) {
std::fprintf(stderr,
- "FAIL lexical nontrivial taskloop replay first=%d second=%d
ctors=%d dtors=%d\n",
+ "FAIL lexical nontrivial taskloop replay first=%d second=%d "
+ "ctors=%d dtors=%d\n",
first, second, Tracker::Ctors, Tracker::Dtors);
return 1;
}
std::fprintf(stderr,
- "PASS lexical nontrivial taskloop replay first=%d second=%d
ctors=%d dtors=%d\n",
+ "PASS lexical nontrivial taskloop replay first=%d second=%d "
+ "ctors=%d dtors=%d\n",
first, second, Tracker::Ctors, Tracker::Dtors);
return 0;
}
diff --git
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_pointer_recursive_frameid_taskloop.cpp
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_pointer_recursive_frameid_taskloop.cpp
index 5c5aada22..fe093ac38 100644
---
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_pointer_recursive_frameid_taskloop.cpp
+++
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_pointer_recursive_frameid_taskloop.cpp
@@ -34,7 +34,8 @@ __attribute__((noinline)) static int
run_recursive_frameid(int depth, int seed,
// I probably wouldn't recommend use of this technique in production code.
#pragma omp taskgraph graph_id(frame_gid)
{
-#pragma omp taskloop replayable num_tasks(8) shared(ptr_ref, depth, run_tag)
reduction(+ : sum_delta)
+#pragma omp taskloop replayable num_tasks(8) shared(ptr_ref, depth, run_tag)
\
+ reduction(+ : sum_delta)
for (int i = 0; i < 16; ++i) {
int delta = (depth + 1) * 3 + run_tag + i;
__atomic_fetch_add(ptr_ref, delta, __ATOMIC_RELAXED);
@@ -69,13 +70,15 @@ int main() {
const int expected_replayed = 2 * recorded_sum;
if (replayed_sum == expected_replayed) {
std::fprintf(stderr,
- "UNEXPECTED SUCCESS recursive pointer taskloop replay
recorded=%d replayed_total=%d expected_total=%d\n",
+ "UNEXPECTED SUCCESS recursive pointer taskloop replay "
+ "recorded=%d replayed_total=%d expected_total=%d\n",
recorded_sum, replayed_sum, expected_replayed);
return 0;
}
std::fprintf(stderr,
- "EXPECTED FAILURE recursive pointer taskloop replay recorded=%d
replayed_total=%d expected_total=%d\n",
+ "EXPECTED FAILURE recursive pointer taskloop replay recorded=%d
"
+ "replayed_total=%d expected_total=%d\n",
recorded_sum, replayed_sum, expected_replayed);
return 1;
}
diff --git
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_pointer_taskloop.cpp
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_pointer_taskloop.cpp
index 8e8f98f4d..ac5471505 100644
---
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_pointer_taskloop.cpp
+++
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_pointer_taskloop.cpp
@@ -28,14 +28,16 @@ int main() {
if (first != 136 || second != 1720) {
std::fprintf(stderr,
- "FAIL lexical pointer shared taskloop replay first=%d
second=%d expected=136/1720\n",
+ "FAIL lexical pointer shared taskloop replay first=%d "
+ "second=%d expected=136/1720\n",
first, second);
return 1;
}
- std::fprintf(stderr,
- "PASS lexical pointer shared taskloop replay first=%d
second=%d\n",
- first, second);
+ std::fprintf(
+ stderr,
+ "PASS lexical pointer shared taskloop replay first=%d second=%d\n",
first,
+ second);
return 0;
}
diff --git
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_recursive_taskloop.cpp
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_recursive_taskloop.cpp
index 6325c9055..32e3a6f3d 100644
---
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_recursive_taskloop.cpp
+++
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_recursive_taskloop.cpp
@@ -24,7 +24,8 @@ __attribute__((noinline)) static int expected_recursive(int
depth, int seed) {
return local + expected_recursive(depth - 1, seed + 10);
}
-__attribute__((noinline)) static int run_taskgraph_recursive(int depth, int
seed) {
+__attribute__((noinline)) static int run_taskgraph_recursive(int depth,
+ int seed) {
int x = seed;
int *ptr = &x;
int sum_delta = 0;
@@ -32,7 +33,8 @@ __attribute__((noinline)) static int
run_taskgraph_recursive(int depth, int seed
#pragma omp taskgraph graph_id(gid)
{
-#pragma omp taskloop replayable num_tasks(8) shared(ptr, depth) reduction(+ :
sum_delta)
+#pragma omp taskloop replayable num_tasks(8) shared(ptr, depth)
\
+ reduction(+ : sum_delta)
for (int i = 0; i < 16; ++i) {
int delta = depth + i + 1;
__atomic_fetch_add(ptr, delta, __ATOMIC_RELAXED);
@@ -56,13 +58,15 @@ int main() {
if (first == expected_first && second == expected_second) {
std::fprintf(stderr,
- "UNEXPECTED SUCCESS lexical recursive taskloop replay
first=%d second=%d expected=%d/%d\n",
+ "UNEXPECTED SUCCESS lexical recursive taskloop replay "
+ "first=%d second=%d expected=%d/%d\n",
first, second, expected_first, expected_second);
return 0;
}
std::fprintf(stderr,
- "EXPECTED FAILURE lexical recursive taskloop replay first=%d
second=%d expected=%d/%d\n",
+ "EXPECTED FAILURE lexical recursive taskloop replay first=%d "
+ "second=%d expected=%d/%d\n",
first, second, expected_first, expected_second);
return 1;
}
diff --git
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_works_taskloop.cpp
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_works_taskloop.cpp
index cf2bf8947..beaaedfea 100644
---
a/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_works_taskloop.cpp
+++
b/openmp/runtime/test/taskgraph/taskgraph_replayable_lexical_shared_works_taskloop.cpp
@@ -27,7 +27,8 @@ int main() {
if (first != 136 || second != 1720) {
std::fprintf(stderr,
- "FAIL lexical shared taskloop replay first=%d second=%d
expected=136/1720\n",
+ "FAIL lexical shared taskloop replay first=%d second=%d "
+ "expected=136/1720\n",
first, second);
return 1;
}
diff --git
a/openmp/runtime/test/taskgraph/taskgraph_replayable_nonlexical_shared_fails_1_taskloop.cpp
b/openmp/runtime/test/taskgraph/taskgraph_replayable_nonlexical_shared_fails_1_taskloop.cpp
index 23bcb8c6b..ee81bea27 100644
---
a/openmp/runtime/test/taskgraph/taskgraph_replayable_nonlexical_shared_fails_1_taskloop.cpp
+++
b/openmp/runtime/test/taskgraph/taskgraph_replayable_nonlexical_shared_fails_1_taskloop.cpp
@@ -21,7 +21,9 @@ __attribute__((noinline)) static int
run_taskgraph_nonlexical(int seed) {
int out = -1;
#pragma omp taskgraph graph_id(631)
- { out = emit_nonlexical_taskloop(x); }
+ {
+ out = emit_nonlexical_taskloop(x);
+ }
return out;
}
@@ -32,15 +34,18 @@ int main() {
if (recorded == replayed) {
std::fprintf(stderr,
- "UNEXPECTED SUCCESS nonlexical taskloop replay recorded=%d
replayed=%d\n",
+ "UNEXPECTED SUCCESS nonlexical taskloop replay recorded=%d "
+ "replayed=%d\n",
recorded, replayed);
return 0;
}
- std::fprintf(stderr,
- "EXPECTED FAILURE nonlexical taskloop replay recorded=%d
replayed=%d\n",
- recorded, replayed);
+ std::fprintf(
+ stderr,
+ "EXPECTED FAILURE nonlexical taskloop replay recorded=%d replayed=%d\n",
+ recorded, replayed);
return 1;
}
-// CHECK: OMP: Error #302: Cannot locate captured shared variable reference
for taskgraph replay
+// CHECK: OMP: Error #302: Cannot locate captured shared variable reference for
+// taskgraph replay
diff --git
a/openmp/runtime/test/taskgraph/taskgraph_replayable_nonlexical_shared_fails_2_taskloop.cpp
b/openmp/runtime/test/taskgraph/taskgraph_replayable_nonlexical_shared_fails_2_taskloop.cpp
index f0648d5cb..1c92ac85d 100644
---
a/openmp/runtime/test/taskgraph/taskgraph_replayable_nonlexical_shared_fails_2_taskloop.cpp
+++
b/openmp/runtime/test/taskgraph/taskgraph_replayable_nonlexical_shared_fails_2_taskloop.cpp
@@ -45,15 +45,18 @@ int main() {
if (recorded == replayed) {
std::fprintf(stderr,
- "UNEXPECTED SUCCESS nonlexical taskloop replay recorded=%d
replayed=%d\n",
+ "UNEXPECTED SUCCESS nonlexical taskloop replay recorded=%d "
+ "replayed=%d\n",
recorded, replayed);
return 0;
}
- std::fprintf(stderr,
- "EXPECTED FAILURE nonlexical taskloop replay recorded=%d
replayed=%d\n",
- recorded, replayed);
+ std::fprintf(
+ stderr,
+ "EXPECTED FAILURE nonlexical taskloop replay recorded=%d replayed=%d\n",
+ recorded, replayed);
return 1;
}
-// CHECK: OMP: Error #302: Cannot locate captured shared variable reference
for taskgraph replay
+// CHECK: OMP: Error #302: Cannot locate captured shared variable reference for
+// taskgraph replay
diff --git
a/openmp/runtime/test/taskgraph/taskgraph_replayable_saved_stack_depth_taskloop.cpp
b/openmp/runtime/test/taskgraph/taskgraph_replayable_saved_stack_depth_taskloop.cpp
index 268e7664e..5a5b8352f 100644
---
a/openmp/runtime/test/taskgraph/taskgraph_replayable_saved_stack_depth_taskloop.cpp
+++
b/openmp/runtime/test/taskgraph/taskgraph_replayable_saved_stack_depth_taskloop.cpp
@@ -39,9 +39,9 @@ __attribute__((noinline)) static void clobber_stack(int base)
{
// nothing to refresh at replay since the saved snapshots are sourced from
// '.kmp_privates.t', not the shareds slots.
__attribute__((noinline)) static void emit_replayable_taskloop(int seed) {
- Payload payload{{seed + 1, seed + 3, seed + 5, seed + 7, seed + 11,
- seed + 13},
- seed * 17 + 19};
+ Payload payload{
+ {seed + 1, seed + 3, seed + 5, seed + 7, seed + 11, seed + 13},
+ seed * 17 + 19};
#pragma omp taskloop replayable num_tasks(8) firstprivate(saved : payload,
seed)
for (int i = 0; i < 16; ++i) {
@@ -55,7 +55,9 @@ __attribute__((noinline)) static int run_taskgraph(int seed) {
Aggregate = 0;
#pragma omp taskgraph graph_id(633)
- { emit_replayable_taskloop(seed); }
+ {
+ emit_replayable_taskloop(seed);
+ }
return Aggregate;
}
@@ -74,9 +76,9 @@ __attribute__((noinline)) static int call_with_depth(int
seed, int depth) {
}
__attribute__((noinline)) static int expected_result(int seed) {
- Payload payload{{seed + 1, seed + 3, seed + 5, seed + 7, seed + 11,
- seed + 13},
- seed * 17 + 19};
+ Payload payload{
+ {seed + 1, seed + 3, seed + 5, seed + 7, seed + 11, seed + 13},
+ seed * 17 + 19};
int sum = 0;
for (int i = 0; i < 16; ++i)
sum += evaluate_payload(payload, seed + i);
@@ -107,9 +109,10 @@ int main() {
clobber_stack(Seeds[i] * 1000);
const int replayed = call_with_depth(Seeds[i], Depths[i]);
if (replayed != recorded) {
- std::fprintf(stderr,
- "FAIL taskloop replay %d depth=%d seed=%d got=%d
expected=%d\n",
- i, Depths[i], Seeds[i], replayed, recorded);
+ std::fprintf(
+ stderr,
+ "FAIL taskloop replay %d depth=%d seed=%d got=%d expected=%d\n",
+ i, Depths[i], Seeds[i], replayed, recorded);
failed = true;
}
}
@@ -119,7 +122,8 @@ int main() {
if (failed)
return 1;
- std::fprintf(stderr, "PASS replayable taskloop saved stack result=%d\n",
recorded);
+ std::fprintf(stderr, "PASS replayable taskloop saved stack result=%d\n",
+ recorded);
return 0;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/200405
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits