[llvm] [Offload][L0] Add support for OffloadBinary format in L0 plugin (PR #185404)

Alex Duran via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 07:01:29 PDT 2026


================
@@ -1651,6 +1677,12 @@ int32_t GenericPluginTy::isPluginCompatible(StringRef Image) {
       return HandleError(std::move(Err));
     return *MatchOrErr;
   }
+  case file_magic::offload_binary: {
----------------
adurang wrote:

There's no much plugin specific portion I'm afraid. The only current functions marked as virtual related to this are `getMagicElfBits` and ` getTripleArch`  in Plugin and ` isELFCompatible`  that don't really allow to accept new formats as they're only invoked in case something is recognized as ELF or LLVM IR.

I think is a good a idea to let the plugins be able to extend the image so I'd suggest to add a new virtual interface (that returns false by default) that is executed when a format is not recognized by the common interface here: https://github.com/llvm/llvm-project/blob/859af271ee26cdcbc44fa0e4872448863c60f228/offload/plugins-nextgen/common/src/PluginInterface.cpp#L1655 and here https://github.com/llvm/llvm-project/blob/859af271ee26cdcbc44fa0e4872448863c60f228/offload/plugins-nextgen/common/src/PluginInterface.cpp#L1692). I can then implement all this new logic only for L0 for now in that interface. Does this sound reasonable?

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


More information about the llvm-commits mailing list