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

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 09:04:09 PDT 2026


================
@@ -969,6 +976,12 @@ struct OpenMPOpt {
       // TODO: This should be folded into buildCustomStateMachine.
       Changed |= rewriteDeviceCodeStateMachine();
 
+      // Drop the parallel data-sharing wrapper from __kmpc_parallel_60 calls in
+      // SPMD kernels, where the runtime never uses it, so the (otherwise dead)
+      // wrapper can be eliminated instead of lingering as a non-kernel LDS
+      // user.
+      Changed |= removeSPMDParallelWrappers();
----------------
ro-i wrote:

it seemed easier to follow with this structure. Because it's not sufficient that the kernel is in `SPMDizedKernels`. We also need to make sure that there is no generic kernel left that might need the reference. At least that was my thinking.

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


More information about the llvm-commits mailing list