[clang] [HIP] Support compressing device binary (PR #67162)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 29 08:38:18 PDT 2023


jhuber6 wrote:

Unrelated, I need to hurry up and try to make the new driver the default for CUDA and HIP upstream at some point.

I've had some thoughts about how to accomplish this in the past. For the new driver, `.llvm.offloading` is a single section that contains all of the embedded device code to create a fat binary. It should be possible to use [ELF compression](https://blogs.oracle.com/solaris/post/elf-section-compression) to reduce the size of that binary. Can we do something similar here? If memory serves, the `clang-offload-bundler` does a similar section embedding for object files. This wouldn't work for LLVM-IR host binaries however, since the host binary won't be an ELF. Also it's not exactly portable with COFF.

@MaskRay do you know if ELF compression is feasible for this application?

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


More information about the cfe-commits mailing list