[clang] [llvm] [clang][OpenMP] Add no-loop SPMD kernel promotion (PR #224041)

Dhruva Chakrabarti via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 13 23:04:37 PDT 2026


================
@@ -146,6 +146,14 @@ class CGOpenMPRuntimeGPU : public CGOpenMPRuntime {
   bool isDelayedVariableLengthDecl(CodeGenFunction &CGF,
                                    const VarDecl *VD) const override;
 
+  /// Check whether the target kernel being emitted is tagged SPMD_NO_LOOP, to
+  /// complete the promotion to a "no-loop" SPMD kernel, mirroring Flang's MLIR
+  /// promotion path.
+  bool canPromoteToNoLoop() const override {
+    return KernelAttrs.ExecFlags ==
----------------
dhruvachak wrote:

I don't like this cache. While today there is no reachable path that gets a wrong answer, not having a directive passed in as the context is error-prone in the future.

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


More information about the cfe-commits mailing list