[llvm-branch-commits] [clang] [CIR][OpenMP] Add support for host_eval so that SPMD kernels can be used (PR #229259)

Erich Keane via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 2 11:50:15 PST 2026


================
@@ -2866,6 +2866,32 @@ class CIRGenFunction : public CIRGenTypeCache {
   //                         OpenMP Emission
   //===--------------------------------------------------------------------===//
 public:
+  /// The enclosing omp.target's host-evaluated loop bounds -- a normalized
+  /// [0, tripCount) range matching emitOMPLoopNest's convention -- forwarded
+  /// as host_eval block arguments and consumed once by the nested
+  /// omp.wsloop.
+  struct OMPHostEvalBounds {
+    mlir::Value zero;
----------------
erichkeane wrote:

What is the purpose of storing zero and 1 here?  They are constants that are effectively forwarded during lowering, aren't they? 

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


More information about the llvm-branch-commits mailing list