snehasish wrote: > Since std::map is already ordered by LineLocation, SampleSorter is redundant. Can you add a test which checks the ordering? Perhaps using the text format profile. Follow up is fine if you want to merge this one. https://github.com/llvm/llvm-project/pull/215941