[XRay] Stable sort XRayRecord to remove non-deterministic ordering

Summary:
This fixes failure in tools/llvm-xray/X86/graph-zero-latency-calls.yaml
uncovered by D39245.

Reviewers: dberris

Reviewed By: dberris

Subscribers: llvm-commits

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

llvm-svn: 318163
This commit is contained in:
Mandeep Singh Grang 2017-11-14 18:11:08 +00:00
parent 0815515b98
commit 21f84e5d5d

View File

@ -606,7 +606,7 @@ Expected<Trace> llvm::xray::loadTraceFile(StringRef Filename, bool Sort) {
}
if (Sort)
std::sort(T.Records.begin(), T.Records.end(),
std::stable_sort(T.Records.begin(), T.Records.end(),
[&](const XRayRecord &L, const XRayRecord &R) {
return L.TSC < R.TSC;
});