[PATCH] D136211: [llvm-profdata] Check for all duplicate entries in MemOpSize table

Matthew Voss via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 16:40:11 PDT 2022


ormris created this revision.
ormris added reviewers: xur, ellis.
Herald added subscribers: Enna1, wenlei, hiraditya.
Herald added a project: All.
ormris requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Previously, we only checked for duplicate zero entries when merging a MemOPSize table (see D92074 <https://reviews.llvm.org/D92074>), but a user recently provided a reproducer demonstrating that other entries can also be duplicated. As demonstrated by the test in this patch, PGOMemOPSizeOpt can potentially generate invalid IR for non-zero, non-consecutive duplicate entries. This seems to be a rare case, since the duplicate entry is often below the threshold, but possible. This patch extends the existing warning to check for any duplicate values in the table, both in the optimization and in llvm-profdata. We're hoping that this expanded warning will catch more examples of this behavior so we can diagnose the root cause of these duplicate entries more easily.


https://reviews.llvm.org/D136211

Files:
  llvm/lib/ProfileData/InstrProfWriter.cpp
  llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp
  llvm/test/Transforms/PGOProfile/Inputs/duplicate-values.proftext
  llvm/test/Transforms/PGOProfile/duplicate-memop-values.ll
  llvm/test/tools/llvm-profdata/invalid-profile-gen-dup-entries.proftext

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136211.468739.patch
Type: text/x-patch
Size: 5552 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221018/8f7c163b/attachment.bin>


More information about the llvm-commits mailing list