[PATCH] D149924: [MemProf] Use MapVector to avoid non-determinism

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 21:00:21 PDT 2023


tejohnson created this revision.
tejohnson added a reviewer: snehasish.
Herald added subscribers: hoy, ormris, steven_wu, mgrang, hiraditya.
Herald added a project: All.
tejohnson requested review of this revision.
Herald added a project: LLVM.

Multiple cases of instability in the cloning behavior occurred due to
iteration of maps indexed by pointers. Fix by changing the maps to
MapVector. This necessitated adding DenseMapInfo specializations for the
structure types used in the keys.

These were found while trying to commit patch 3 of the cloning
(bfe7205975a63a605ff3faacd97fe4c1bf4c19b3 <https://reviews.llvm.org/rGbfe7205975a63a605ff3faacd97fe4c1bf4c19b3>), but the second one turned
out to be in code committed in patch 2, but just exposed by a new test
added with patch 3. Specifically, the iteration in identifyClones().

Added the portion of the new test cases from patch 3 that only relied on
the already committed changes and exposed the issue.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149924

Files:
  llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
  llvm/test/ThinLTO/X86/memprof-funcassigncloning.ll
  llvm/test/Transforms/MemProfContextDisambiguation/funcassigncloning.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149924.519737.patch
Type: text/x-patch
Size: 16844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230505/64785ae2/attachment.bin>


More information about the llvm-commits mailing list