Skip to content

[ctxprof] Profile format support for flat profiles #129592

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

Conversation

mtrofin
Copy link
Member

@mtrofin mtrofin commented Mar 3, 2025

No description provided.

Copy link
Member Author

mtrofin commented Mar 3, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

github-actions bot commented Mar 3, 2025

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

You can test this locally with the following command:
git-clang-format --diff 21d73ce90b4f2be759a602644c7a6b3fa7382111 510c296183e4fed1d9fd834d4ff5670cd788f3a7 --extensions h,cpp -- llvm/include/llvm/Analysis/CtxProfAnalysis.h llvm/include/llvm/ProfileData/PGOCtxProfReader.h llvm/include/llvm/ProfileData/PGOCtxProfWriter.h llvm/lib/Analysis/CtxProfAnalysis.cpp llvm/lib/ProfileData/PGOCtxProfReader.cpp llvm/lib/ProfileData/PGOCtxProfWriter.cpp llvm/lib/Transforms/IPO/ElimAvailExtern.cpp llvm/lib/Transforms/IPO/FunctionImport.cpp llvm/lib/Transforms/IPO/ModuleInliner.cpp llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp llvm/lib/Transforms/Utils/InlineFunction.cpp llvm/tools/llvm-ctxprof-util/llvm-ctxprof-util.cpp llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp
View the diff from clang-format here.
diff --git a/llvm/include/llvm/ProfileData/PGOCtxProfReader.h b/llvm/include/llvm/ProfileData/PGOCtxProfReader.h
index 52a1b42f87..4445bef530 100644
--- a/llvm/include/llvm/ProfileData/PGOCtxProfReader.h
+++ b/llvm/include/llvm/ProfileData/PGOCtxProfReader.h
@@ -192,7 +192,7 @@ class PGOCtxProfileReader final {
 
   Expected<std::pair<std::optional<uint32_t>, PGOCtxProfContext>>
   readProfile(PGOCtxProfileBlockIDs Kind);
-    
+
   bool canEnterBlockWithID(PGOCtxProfileBlockIDs ID);
   Error enterBlockWithID(PGOCtxProfileBlockIDs ID);
 
diff --git a/llvm/lib/ProfileData/PGOCtxProfWriter.cpp b/llvm/lib/ProfileData/PGOCtxProfWriter.cpp
index c8ea779602..22a670e825 100644
--- a/llvm/lib/ProfileData/PGOCtxProfWriter.cpp
+++ b/llvm/lib/ProfileData/PGOCtxProfWriter.cpp
@@ -71,8 +71,7 @@ void PGOCtxProfileWriter::writeCounters(ArrayRef<uint64_t> Counters) {
 }
 
 void PGOCtxProfileWriter::writeGuid(ctx_profile::GUID Guid) {
-  Writer.EmitRecord(PGOCtxProfileRecords::Guid,
-    SmallVector<uint64_t, 1>{Guid});
+  Writer.EmitRecord(PGOCtxProfileRecords::Guid, SmallVector<uint64_t, 1>{Guid});
 }
 
 // recursively write all the subcontexts. We do need to traverse depth first to
@@ -102,9 +101,7 @@ void PGOCtxProfileWriter::startContextSection() {
   Writer.EnterSubblock(PGOCtxProfileBlockIDs::ContextsSectionBlockID, CodeLen);
 }
 
-void PGOCtxProfileWriter::endContextSection() {
-  Writer.ExitBlock();
-}
+void PGOCtxProfileWriter::endContextSection() { Writer.ExitBlock(); }
 
 void PGOCtxProfileWriter::writeContextual(const ContextNode &RootNode) {
   writeImpl(std::nullopt, RootNode);

@mtrofin mtrofin closed this Mar 4, 2025
@mtrofin mtrofin deleted the users/mtrofin/03-03-_ctxprof_profile_format_support_for_flat_profiles branch March 4, 2025 01:42
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.

1 participant