[PATCH] D66191: [AutoFDO] Make call targets order deterministic for sample profil

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 17:52:49 PDT 2019


wenlei created this revision.
wenlei added reviewers: wmi, davidxl, danielcdh.
Herald added subscribers: llvm-commits, mgrang, hiraditya.
Herald added a project: LLVM.
wenlei updated this revision to Diff 214997.
wenlei added a comment.

update description


StringMap is used for storing call target to frequency map for AutoFDO. However the iterating order of StringMap is non-deterministic, which leads to non-determinism in AutoFDO profile output. Now StringMap is changed to std::map for deterministic ordering and output.

Roundtrip test for text profile and binary profile is added.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66191

Files:
  llvm/include/llvm/ProfileData/SampleProf.h
  llvm/lib/ProfileData/SampleProf.cpp
  llvm/lib/ProfileData/SampleProfWriter.cpp
  llvm/lib/Target/X86/X86InsertPrefetch.cpp
  llvm/lib/Transforms/IPO/SampleProfile.cpp
  llvm/test/tools/llvm-profdata/Inputs/sample-profile.proftext
  llvm/test/tools/llvm-profdata/roundtrip.test
  llvm/test/tools/llvm-profdata/sample-profile-basic.test
  llvm/tools/llvm-profdata/llvm-profdata.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66191.214997.patch
Type: text/x-patch
Size: 7179 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190814/d33a381d/attachment.bin>


More information about the llvm-commits mailing list