[lld] 2a80c3d - [ELF] Clarify that Z_BEST_SPEED==1 in a comment. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 25 22:40:57 PST 2022
Author: Fangrui Song
Date: 2022-01-25T22:40:53-08:00
New Revision: 2a80c3dbe17175cd99112838341411323473f68b
URL: https://github.com/llvm/llvm-project/commit/2a80c3dbe17175cd99112838341411323473f68b
DIFF: https://github.com/llvm/llvm-project/commit/2a80c3dbe17175cd99112838341411323473f68b.diff
LOG: [ELF] Clarify that Z_BEST_SPEED==1 in a comment. NFC
Added:
Modified:
lld/ELF/OutputSections.cpp
Removed:
################################################################################
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index e97d23798d03..c4c11236a336 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -340,10 +340,11 @@ template <class ELFT> void OutputSection::maybeCompress() {
// Write uncompressed data to a temporary zero-initialized buffer.
auto buf = std::make_unique<uint8_t[]>(size);
writeTo<ELFT>(buf.get());
- // We chose 1 as the default compression level because it is the fastest. If
- // -O2 is given, we use level 6 to compress debug info more by ~15%. We found
- // that level 7 to 9 doesn't make much
diff erence (~1% more compression) while
- // they take significant amount of time (~2x), so level 6 seems enough.
+ // We chose 1 (Z_BEST_SPEED) as the default compression level because it is
+ // the fastest. If -O2 is given, we use level 6 to compress debug info more by
+ // ~15%. We found that level 7 to 9 doesn't make much
diff erence (~1% more
+ // compression) while they take significant amount of time (~2x), so level 6
+ // seems enough.
const int level = config->optimize >= 2 ? 6 : Z_BEST_SPEED;
// Split input into 1-MiB shards.
More information about the llvm-commits
mailing list