[MemProf] Use stable_sort to avoid non-determinism
authorTeresa Johnson <tejohnson@google.com>
Thu, 23 Mar 2023 16:15:57 +0000 (09:15 -0700)
committerTeresa Johnson <tejohnson@google.com>
Thu, 23 Mar 2023 16:20:39 +0000 (09:20 -0700)
commitdc2f2d2180f1d1a1835dc55478d3bcceea41a4b1
tree9c16ce261b44c7a5af41606199e810fe2366e082
parentec294d2f8f1839e11c13ee32279cd28c1f46f66f
[MemProf] Use stable_sort to avoid non-determinism

Switch from std::sort to std::stable_sort when sorting callsites to
avoid non-determinism when the comparisons are equal. This showed up in
internal testing of fe27495be2040007c7b20844a9371b06156ab405.
llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp