[all-commits] [llvm/llvm-project] f27fee: [SamplePGO][NFC] Dump function profiles in order

Hongtao Yu via All-commits all-commits at lists.llvm.org
Mon Aug 16 17:43:09 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f27fee623d0124c64a73374d0256819396647864
      https://github.com/llvm/llvm-project/commit/f27fee623d0124c64a73374d0256819396647864
  Author: Hongtao Yu <hoy at fb.com>
  Date:   2021-08-16 (Mon, 16 Aug 2021)

  Changed paths:
    M llvm/include/llvm/ProfileData/SampleProf.h
    M llvm/lib/ProfileData/SampleProf.cpp
    M llvm/lib/ProfileData/SampleProfReader.cpp
    M llvm/lib/ProfileData/SampleProfWriter.cpp
    M llvm/test/tools/llvm-profdata/Inputs/profile-symbol-list.expected

  Log Message:
  -----------
  [SamplePGO][NFC] Dump function profiles in order

Sample profiles are stored in a string map which is basically an unordered map. Printing out profiles by simply walking the string map doesn't enforce an order. I'm sorting the map in the decreasing order of total samples to enable a more stable dump, which is good for comparing two dumps.

Reviewed By: wenlei, wlei

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




More information about the All-commits mailing list