[PATCH] D92074: [llvm-profdata] Emit Error when Invalid MemOpSize Section is Created by llvm-profdata

Matthew Voss via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 23:23:11 PST 2020


ormris created this revision.
ormris added reviewers: MaskRay, wmi, vsk.
Herald added subscribers: wenlei, hiraditya.
Herald added a project: LLVM.
ormris requested review of this revision.

Under certain (currently unknown) conditions, llvm-profdata is outputting
profiles that have two consecutive entries in the MemOPSize section for the
value 0. This causes the PGOMemOPSizeOpt pass to output an invalid switch
instruction with two cases for 0. As mentioned, we’re not quite sure what’s
causing this to happen, but this patch prevents llvm-profdata from outputting a
profile that has this problem and gives an error with a request for a
reproducible.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92074

Files:
  llvm/include/llvm/ProfileData/InstrProf.h
  llvm/include/llvm/ProfileData/InstrProfWriter.h
  llvm/lib/ProfileData/InstrProf.cpp
  llvm/lib/ProfileData/InstrProfWriter.cpp
  llvm/test/tools/llvm-profdata/invalid-profile-gen-zeros.proftext
  llvm/tools/llvm-profdata/llvm-profdata.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92074.307519.patch
Type: text/x-patch
Size: 6285 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201125/ce2d1eb6/attachment.bin>


More information about the llvm-commits mailing list