[clang] [llvm] [HIP] add --offload-compression-level= option (PR #83605)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 4 10:48:18 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;
----------------
Artem-B wrote:

> compiling kernels to bitcode for 6 GPU takes 30s. compression with zstd level 20 takes 2s.

This looks acceptable for me.

> unless zstd can be parallelized.

zstd does support multithreaded compression, but enabling it would run into the same issue we had with enabling multi-threaded compilation -- it will interfere with the build system's idea of resource usage. 


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


More information about the cfe-commits mailing list