[PATCH] D18487: [ThinLTO] Add optional import message and statistics

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 13:28:40 PDT 2020


aganea added inline comments.
Herald added subscribers: dexonsmith, inglorion.


================
Comment at: llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp:359
+      for (const auto *GV : GlobalsToImport)
+        dbgs() << DestModule.getSourceFileName() << ": Import " << GV->getName()
+               << " from " << SrcModule->getSourceFileName() << "\n";
----------------
Hello Teresa! This debug output is not thread-safe, but it is executed from ThinLTO threads. There's a test, `llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp3.ll` which relies on this output. Currently that test only uses one thread (`-thinlto-threads=1`). However when using any other number of threads, the test randomly fails.
I wanted to test other values for `-thinlto-threads` in D75153, but I cannot. I'd like to land that patch, and would like your advice.

What avenue would you suggest? Add/use a mutex here? Remove the coverage for `thinlto_samplepgo_icp3.ll` in D75153?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D18487





More information about the llvm-commits mailing list