[PATCH] D146182: [llvm-profdata] Fixed various issue with Sample Profile Reader

William Junda Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 17:25:55 PDT 2023


huangjd created this revision.
Herald added subscribers: wenlei, hiraditya.
Herald added a project: All.
huangjd requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fixed various undefind behaviors with current Sample Profile Reader when reading unusual input. Furthermore, add the following rule on allowing multiple name table sections (current Reader has conflicted code handling such case):

  When a new name table section is read (in the order sections are read), the names in the previous name table are cleared. Any subsequent sections referring to function names will index into the most recent read name table.

Also changed name table index to uint64_t to be consistent since there's a mix of using uint32_t and uint64_t.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146182

Files:
  llvm/include/llvm/ProfileData/SampleProf.h
  llvm/include/llvm/ProfileData/SampleProfReader.h
  llvm/lib/ProfileData/SampleProfReader.cpp
  llvm/test/tools/llvm-profdata/Inputs/sample-multiple-nametables.profdata
  llvm/test/tools/llvm-profdata/Inputs/sample-nametable-after-samples.profdata
  llvm/test/tools/llvm-profdata/Inputs/sample-nametable-empty-string.profdata
  llvm/test/tools/llvm-profdata/sample-nametable.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146182.505666.patch
Type: text/x-patch
Size: 12823 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230316/ce808d21/attachment.bin>


More information about the llvm-commits mailing list