[llvm] [Offload][OpenMP] Fix RPC callback registration when RPC server is not initialized (PR #210215)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 17 03:47:27 PDT 2026
Wijkqwe wrote:
> > This happens in practice if you initialize plugin before Fortran `ProgramStart`.
>
> Any way we can make it not do that?
Per the community's direction for `offload/`, the subproject is building a unified API (`liboffload`) on top of `plugins-nextgen` to serve multiple offloading language runtimes, not just OpenMP. That means more entry points will call into the plugin layer under varied init orderings, so a null‑safe `getRPCServerOrNull()` is a better shared pattern to establish than relying on the asserting accessor in my option.
And about why the unguarded call can be reached in practice: the 0‑device path (`NumDevices == 0`) in `GenericPluginTy::init()` sets `Initialized = true` but skips creating RPCServer, so `is_initialized()` is true while RPCServer is null. This is a legitimate plugin state (no devices present), not an error, and it is triggered under a specific init ordering.
https://github.com/llvm/llvm-project/pull/210215
More information about the llvm-commits
mailing list