[llvm] [OpenMPOpt] Null generic-mode wrappers for SPMDized kernels (PR #207611)
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 30 16:57:00 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();
----------------
jdoerfert wrote:
The way you have it now (with unique kernel) you could cleanup early. That said, if you later want to iterate over reaching kernels and allow multiple as long as they are SPMD, you want to do it late (after SPMDzation is done). Thus, where you put it now is likely better long term.
https://github.com/llvm/llvm-project/pull/207611
More information about the llvm-commits
mailing list