Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InstrProf]Merge vtable names from multiple sources in llvm-profdata #90100

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

minglotus-6
Copy link
Contributor

@minglotus-6 minglotus-6 commented Apr 25, 2024

This is essentially nfc but added for completeness, since llvm-profdata merge should merge profiles from the same instrumented binary, and the set of vtable names remains fixed for the same instrumented binary.

Otherwise, if value profiles from different instrumented binaries are used, the number of instrumented points for a particular function could be different; this could cause warnings at merge time or profile use time.

Copy link

github-actions bot commented Apr 25, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 965f3ca3dc5464892e283e176bf058ae04d8b654 a67841bde64236e68fc8be0f30cba51204d2265e -- llvm/lib/ProfileData/InstrProfWriter.cpp
View the diff from clang-format here.
diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp
index d842cdd278..5fe95d3b51 100644
--- a/llvm/lib/ProfileData/InstrProfWriter.cpp
+++ b/llvm/lib/ProfileData/InstrProfWriter.cpp
@@ -385,7 +385,7 @@ void InstrProfWriter::mergeRecordsFromWriter(InstrProfWriter &&IPW,
   for (auto &I : IPW.BinaryIds)
     addBinaryIds(I);
 
-  for (auto& kv: IPW.VTableNames)
+  for (auto &kv : IPW.VTableNames)
     addVTableName(kv.getKey());
 
   addTemporalProfileTraces(IPW.TemporalProfTraces,

@minglotus-6 minglotus-6 requested a review from david-xl May 8, 2024 20:59
@minglotus-6 minglotus-6 marked this pull request as ready for review May 8, 2024 20:59
@@ -385,6 +385,9 @@ void InstrProfWriter::mergeRecordsFromWriter(InstrProfWriter &&IPW,
for (auto &I : IPW.BinaryIds)
addBinaryIds(I);

for (auto& kv: IPW.VTableNames)
addVTableName(kv.getKey());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we catch inconsistency here instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants