[PATCH] D155733: [lld-macho] Change UUID calculation to use constant chunk count

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 11:01:05 PDT 2023


keith created this revision.
keith added a reviewer: int3.
Herald added projects: lld-macho, All.
Herald added a reviewer: lld-macho.
keith requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Using the current machine's thread count as the chunkCount results in
non-deterministic binaries across machines with different core counts.
This is an attempt to pick a relatively reasoanble number for the
average case. Theoretically this could be configurable.

Fixes: https://github.com/llvm/llvm-project/issues/63961


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155733

Files:
  lld/MachO/Writer.cpp


Index: lld/MachO/Writer.cpp
===================================================================
--- lld/MachO/Writer.cpp
+++ lld/MachO/Writer.cpp
@@ -1180,7 +1180,7 @@
   TimeTraceScope timeScope("Computing UUID");
 
   ArrayRef<uint8_t> data{buffer->getBufferStart(), buffer->getBufferEnd()};
-  unsigned chunkCount = parallel::strategy.compute_thread_count() * 10;
+  unsigned chunkCount = 100;
   // Round-up integer division
   size_t chunkSize = (data.size() + chunkCount - 1) / chunkCount;
   std::vector<ArrayRef<uint8_t>> chunks = split(data, chunkSize);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155733.542117.patch
Type: text/x-patch
Size: 563 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230719/de609534/attachment.bin>


More information about the llvm-commits mailing list