How to parse NVVM bytecode returned by nvrtcGetNVVM

I’m trying to perform some IR transformations on the NVVM output from the NVRTC C++ compiler running in LTO mode in order to generate a megakernel from a set of user-defined kernels.

I was hoping this would be as simple as calling nvrtcGetNVVM and then passing the resulting bitcode to standard LLVM tooling, but that doesn’t seem to be the case.

Specifically the data returned by this function doesn’t seem to be in the standard LLVM bitcode format used by LLVM (or the libnvvm functions).

Is there any way for me to convert the data returned by nvrtcGetNVVM to standard LLVM bitcode? Ideally I would be able to perform some transformations and then pass it back to cuLinkAddData or libnvvm (either works) for compilation.