[llvm] [OpenMPOpt] Null generic-mode wrappers for SPMDized kernels (PR #207611)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 07:39:57 PDT 2026


================
@@ -2250,6 +2268,47 @@ bool OpenMPOpt::rewriteDeviceCodeStateMachine() {
   return Changed;
 }
 
+bool OpenMPOpt::removeSPMDParallelWrappers() {
+  // Nothing to clean up unless we SPMD-ized at least one kernel.
+  if (OMPInfoCache.SPMDizedKernels.empty())
+    return false;
+
+  OMPInformationCache::RuntimeFunctionInfo &KernelParallelRFI =
+      OMPInfoCache.RFIs[OMPRTL___kmpc_parallel_60];
+  if (!KernelParallelRFI || !KernelParallelRFI.Declaration)
+    return false;
+
+  const unsigned WrapperFunctionArgNo = 6;
----------------
shiltian wrote:

nit:
```suggestion
  constexpr unsigned WrapperFunctionArgNo = 6;
```

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


More information about the llvm-commits mailing list