[PATCH] D154680: [llvm-exegesis] Make SubprocessMemoryTest use PIDs

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 07:43:33 PDT 2023


bjope added inline comments.


================
Comment at: llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp:42
+                                  const unsigned DefinitionNumber) {
+    return "/" + std::to_string(getpid() * TestNumber) + "memdef" +
+           std::to_string(DefinitionNumber);
----------------
bjope wrote:
> Multiplying a pid with a number seems a bit weird to me. It is not really guaranteed to result in a number unique to the process (pid=1 and TestNumber=2 gives the same value as pid=2 and TestNumber=1). And I don't know if this multiplication potentially could overflow as well.
Any news about this? Do you agree that the multiplication is weird?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154680



More information about the llvm-commits mailing list