diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2023-10-04 09:32:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 09:32:56 -0400 |
commit | a1e81d2ead02e041471ec2299d7382f80c4dbba6 (patch) | |
tree | c2a2d0bda64c337d9e7b5c597cf2b93cc40fdbe8 /llvm/lib/Object/ObjectFile.cpp | |
parent | ff48e83f18eea446cebc3e14c67ab53a9174616b (diff) | |
download | llvm-a1e81d2ead02e041471ec2299d7382f80c4dbba6.zip llvm-a1e81d2ead02e041471ec2299d7382f80c4dbba6.tar.gz llvm-a1e81d2ead02e041471ec2299d7382f80c4dbba6.tar.bz2 |
[HIP] Support compressing device binary (#67162)
Add option -f[no-]offload-compress to clang to enable/disable
compression of device binary for HIP. By default it is disabled.
Add option -compress to clang-offload-bundler to enable compression of
offload bundle. By default it is disabled.
When enabled, zstd or zlib is used for compression when available.
When disabled, it is NFC compared to previous behavior. The same offload
bundle format is used as before.
Clang-offload-bundler automatically detects whether the input file to be
unbundled is compressed and the compression method and decompress if
necessary.
Diffstat (limited to 'llvm/lib/Object/ObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/ObjectFile.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp index 2a67246..428166f 100644 --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -158,6 +158,8 @@ ObjectFile::createObjectFile(MemoryBufferRef Object, file_magic Type, case file_magic::cuda_fatbinary: case file_magic::offload_binary: case file_magic::dxcontainer_object: + case file_magic::offload_bundle: + case file_magic::offload_bundle_compressed: return errorCodeToError(object_error::invalid_file_type); case file_magic::tapi_file: return errorCodeToError(object_error::invalid_file_type); |