================ @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits