[clang] [Clang][OpenMP] Support multidimensional target launch codegen with dims modifier (PR #239860)

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 6 16:53:18 PST 2026


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 -- clang/test/OpenMP/dims_modifier_codegen.cpp clang/lib/CodeGen/CGOpenMPRuntime.cpp clang/lib/CodeGen/CGOpenMPRuntime.h --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 ce2ee37f3..8b27238e1 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -7082,8 +7082,8 @@ CGOpenMPRuntime::getNumThreadsExprForTargetDirective(
       }
     }
     if (ThreadLimitClause)
-      getThreadExprsAndMergeUpperBound(CGF, ThreadLimitClause->getThreadLimit(), UpperBounds,
-                         ThreadLimitExprs);
+      getThreadExprsAndMergeUpperBound(CGF, ThreadLimitClause->getThreadLimit(),
+                                       UpperBounds, ThreadLimitExprs);
     if (const auto *Dir = dyn_cast_or_null<OMPExecutableDirective>(Child)) {
       if (isOpenMPTeamsDirective(Dir->getDirectiveKind()) &&
           !isOpenMPDistributeDirective(Dir->getDirectiveKind())) {
@@ -7118,8 +7118,8 @@ CGOpenMPRuntime::getNumThreadsExprForTargetDirective(
     if (D.hasClausesOfKind<OMPThreadLimitClause>()) {
       CodeGenFunction::RunCleanupsScope ThreadLimitScope(CGF);
       const auto *ThreadLimitClause = D.getSingleClause<OMPThreadLimitClause>();
-      getThreadExprsAndMergeUpperBound(CGF, ThreadLimitClause->getThreadLimit(), UpperBounds,
-                         ThreadLimitExprs);
+      getThreadExprsAndMergeUpperBound(CGF, ThreadLimitClause->getThreadLimit(),
+                                       UpperBounds, ThreadLimitExprs);
     }
     const CapturedStmt *CS = D.getInnermostCapturedStmt();
     getNumThreads(CGF, CS, NTExprs, UpperBounds, UpperBoundsOnly, CondVal);
@@ -7138,8 +7138,8 @@ CGOpenMPRuntime::getNumThreadsExprForTargetDirective(
     if (D.hasClausesOfKind<OMPThreadLimitClause>()) {
       CodeGenFunction::RunCleanupsScope ThreadLimitScope(CGF);
       const auto *ThreadLimitClause = D.getSingleClause<OMPThreadLimitClause>();
-      getThreadExprsAndMergeUpperBound(CGF, ThreadLimitClause->getThreadLimit(), UpperBounds,
-                         ThreadLimitExprs);
+      getThreadExprsAndMergeUpperBound(CGF, ThreadLimitClause->getThreadLimit(),
+                                       UpperBounds, ThreadLimitExprs);
     }
     getNumThreads(CGF, D.getInnermostCapturedStmt(), NTExprs, UpperBounds,
                   UpperBoundsOnly, CondVal);
@@ -7178,13 +7178,14 @@ CGOpenMPRuntime::getNumThreadsExprForTargetDirective(
     if (D.hasClausesOfKind<OMPThreadLimitClause>()) {
       CodeGenFunction::RunCleanupsScope ThreadLimitScope(CGF);
       const auto *ThreadLimitClause = D.getSingleClause<OMPThreadLimitClause>();
-      getThreadExprsAndMergeUpperBound(CGF, ThreadLimitClause->getThreadLimit(), UpperBounds,
-                         ThreadLimitExprs);
+      getThreadExprsAndMergeUpperBound(CGF, ThreadLimitClause->getThreadLimit(),
+                                       UpperBounds, ThreadLimitExprs);
     }
     if (D.hasClausesOfKind<OMPNumThreadsClause>()) {
       CodeGenFunction::RunCleanupsScope NumThreadsScope(CGF);
       const auto *NumThreadsClause = D.getSingleClause<OMPNumThreadsClause>();
-      getThreadExprsAndMergeUpperBound(CGF, NumThreadsClause->getNumThreads(), UpperBounds);
+      getThreadExprsAndMergeUpperBound(CGF, NumThreadsClause->getNumThreads(),
+                                       UpperBounds);
       NTExprs.assign(NumThreadsClause->getNumThreads().begin(),
                      NumThreadsClause->getNumThreads().end());
     }

``````````

</details>


https://github.com/llvm/llvm-project/pull/239860


More information about the cfe-commits mailing list