[PATCH] D115574: [ThinLTO] Fix nondeterministic exit on error.

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 09:30:02 PST 2021


mtrofin added inline comments.


================
Comment at: llvm/tools/llvm-lto2/llvm-lto2.cpp:311
         llvm::heavyweight_hardware_concurrency(Threads));
+  const bool SingleThreaded = ThinLTODistributedIndexes;
+  // Track whether we hit an error; in particular, in the multi-threaded case,
----------------
tejohnson wrote:
> Or if Threads==1
ack, but not needed anymore


================
Comment at: llvm/tools/llvm-lto2/llvm-lto2.cpp:327
+      return;
+    if (SingleThreaded)
+      exit(1);
----------------
tejohnson wrote:
> What is the downside of always deferring the error?
Just that we can exit quicker in that case, and it'd mimic what clang does in non-multi-threaded cases. But I don't think either of those are worth the extra check, so removing the singlethreaded special case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115574/new/

https://reviews.llvm.org/D115574



More information about the llvm-commits mailing list