[all-commits] [llvm/llvm-project] 1a3947: [MemProf] Use MapVector to avoid non-determinism

Teresa Johnson via All-commits all-commits at lists.llvm.org
Fri May 5 07:07:09 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a3947df8545674d937deeba4aaaf08ea39e7153
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2023-05-05 (Fri, 05 May 2023)

  Changed paths:
    M llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
    A llvm/test/ThinLTO/X86/memprof-funcassigncloning.ll
    A llvm/test/Transforms/MemProfContextDisambiguation/funcassigncloning.ll

  Log Message:
  [MemProf] Use MapVector to avoid non-determinism

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), 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.

Differential Revision: https://reviews.llvm.org/D149924

More information about the All-commits mailing list