[llvm-branch-commits] [clang] [CIR][OpenMP] Add support for host_eval so that SPMD kernels can be used (PR #229259)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Oct 5 16:01:07 PDT 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,c -- clang/lib/CIR/CodeGen/CIRGenFunction.h clang/lib/CIR/CodeGen/CIRGenStmtOpenMP.cpp clang/test/CIR/CodeGenOpenMP/target-parallel-for.c --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/CIR/CodeGen/CIRGenFunction.h b/clang/lib/CIR/CodeGen/CIRGenFunction.h
index 9734bed4f..808298f82 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.h
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.h
@@ -22,6 +22,7 @@
#include "Address.h"
+#include "mlir/Dialect/OpenMP/OpenMPClauseOperands.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/BaseSubobject.h"
#include "clang/AST/CharUnits.h"
@@ -37,7 +38,6 @@
#include "clang/CIR/MissingFeatures.h"
#include "clang/CIR/TypeEvaluationKind.h"
#include "clang/CodeGenUtils/StmtUtils.h"
-#include "mlir/Dialect/OpenMP/OpenMPClauseOperands.h"
#include "llvm/ADT/ScopedHashTable.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
diff --git a/clang/lib/CIR/CodeGen/CIRGenStmtOpenMP.cpp b/clang/lib/CIR/CodeGen/CIRGenStmtOpenMP.cpp
index d7c88c71b..0cd500c82 100644
--- a/clang/lib/CIR/CodeGen/CIRGenStmtOpenMP.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenStmtOpenMP.cpp
@@ -55,9 +55,9 @@ checkSynthesizedClauses(CIRGenFunction &cgf, const OMPExecutableDirective &s,
/// exactly one (after unwrapping single-statement compounds).
static const OMPExecutableDirective *
getSingleNestedOMPDirective(const OMPExecutableDirective &s) {
- const Stmt *body = s.getInnermostCapturedStmt()
- ->getCapturedStmt()
- ->IgnoreContainers(/*IgnoreCaptured=*/true);
+ const Stmt *body =
+ s.getInnermostCapturedStmt()->getCapturedStmt()->IgnoreContainers(
+ /*IgnoreCaptured=*/true);
return dyn_cast<OMPExecutableDirective>(body);
}
@@ -822,9 +822,8 @@ emitTargetOp(CIRGenFunction &cgf, const DirectiveTy &s,
bool isSPMD = isTargetSPMD(execDir);
clauseOps.kernelType = mlir::omp::TargetExecModeAttr::get(
- &cgf.getMLIRContext(),
- isSPMD ? mlir::omp::TargetExecMode::spmd
- : mlir::omp::TargetExecMode::generic);
+ &cgf.getMLIRContext(), isSPMD ? mlir::omp::TargetExecMode::spmd
+ : mlir::omp::TargetExecMode::generic);
auto targetOp = mlir::omp::TargetOp::create(builder, begin, clauseOps);
if (!omp::isLastItemInQueue(item, queue) || hasCombinableNestedLeaf(execDir))
``````````
</details>
https://github.com/llvm/llvm-project/pull/229259
More information about the llvm-branch-commits
mailing list