diff options
author | Teresa Johnson <tejohnson@google.com> | 2025-07-28 14:20:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-28 14:20:49 -0700 |
commit | ced3b90738ff6a4c2f5f264e5085477dc59ffcf8 (patch) | |
tree | fffb163849031e9f96ec42f67d353721ff7d2af1 /mlir/lib/Interfaces/FunctionInterfaces.cpp | |
parent | c93d166c58f0f4ac69c58ec54fb08668b462de03 (diff) | |
download | llvm-ced3b90738ff6a4c2f5f264e5085477dc59ffcf8.zip llvm-ced3b90738ff6a4c2f5f264e5085477dc59ffcf8.tar.gz llvm-ced3b90738ff6a4c2f5f264e5085477dc59ffcf8.tar.bz2 |
[MemProf] Change map to vector to avoid unstable iteration (#151039)
We iterate over a std::map indexed by FuncInfo, which is a pair of a
pointer and a clone number. In the ThinLTO case, this isn't an issue as
the function pointer always points to the same FunctionSummary object.
However, for regular LTO, this is a pointer to a Function object, which
is different for each clone. This will lead to unstable iteration order.
This was exposed in a test case added for PR150735, which added a new
instance of iteration over this map.
Since these function clones are added and numbered sequentially, change
this to a vector indexed by clone number, which points to a structure
containing the clone FuncInfo and the call map (the old map's key and
value, respectively).
Diffstat (limited to 'mlir/lib/Interfaces/FunctionInterfaces.cpp')
0 files changed, 0 insertions, 0 deletions