This is completely inaccurate - please see here: NVPTX codegen for llvm.sin (and friends) - #16 by bondhugula
The pointer there is from @csigg and shows how it’s done with XLA. It’s not more than 20 lines of code to add to SerializeToBlob.cpp (before translating to PTX) to link to libdevice. I’m not saying it’s the best way to do it, but that it’s possible and easy.