[clang] [llvm] [HIP] change compress level (PR #83605)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 2 17:30:08 PST 2024
================
@@ -942,20 +942,28 @@ CompressedOffloadBundle::compress(const llvm::MemoryBuffer &Input,
Input.getBuffer().size());
llvm::compression::Format CompressionFormat;
+ int Level;
- if (llvm::compression::zstd::isAvailable())
+ if (llvm::compression::zstd::isAvailable()) {
CompressionFormat = llvm::compression::Format::Zstd;
- else if (llvm::compression::zlib::isAvailable())
+ // Use a high zstd compress level by default for better size reduction.
+ const int DefaultZstdLevel = 20;
----------------
MaskRay wrote:
High levels decrease compression speed substantially. Have you checked that 20 hits a good sweet spot between 9 to 22 (max)?
Is OffloadBundler used more like a linker than a compile action where parallelism helps? If yes, lld/ELF/OutputSections.cpp has some code, which can be copied here. (Please don't share the code, I think some duplication in lld/ELF makes lld code easier to change)
https://github.com/llvm/llvm-project/pull/83605
More information about the cfe-commits
mailing list