[llvm] [SampleFDO][TypeProf] Support vtable type profiling in ext-binary and text format. (PR #141649)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 11:18:27 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- llvm/include/llvm/ProfileData/SampleProf.h llvm/include/llvm/ProfileData/SampleProfReader.h llvm/include/llvm/ProfileData/SampleProfWriter.h llvm/lib/ProfileData/SampleProf.cpp llvm/lib/ProfileData/SampleProfReader.cpp llvm/lib/ProfileData/SampleProfWriter.cpp llvm/tools/llvm-profdata/llvm-profdata.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h
index 8d7a05c4f..4773d059c 100644
--- a/llvm/include/llvm/ProfileData/SampleProf.h
+++ b/llvm/include/llvm/ProfileData/SampleProf.h
@@ -1023,7 +1023,7 @@ public:
     return VirtualCallsiteTypes;
   }
 
-  TypeMap& getTypeSamplesAt(const LineLocation &Loc) {
+  TypeMap &getTypeSamplesAt(const LineLocation &Loc) {
     return VirtualCallsiteTypes[mapIRLocToProfileLoc(Loc)];
   }
 
diff --git a/llvm/include/llvm/ProfileData/SampleProfReader.h b/llvm/include/llvm/ProfileData/SampleProfReader.h
index 6ab3b650c..8de6fefad 100644
--- a/llvm/include/llvm/ProfileData/SampleProfReader.h
+++ b/llvm/include/llvm/ProfileData/SampleProfReader.h
@@ -711,7 +711,6 @@ protected:
     return sampleprof_error::success;
   }
 
-
   /// Points to the current location in the buffer.
   const uint8_t *Data = nullptr;
 
@@ -872,7 +871,8 @@ private:
 
   std::error_code readCallsiteVTableProf(FunctionSamples &FProfile) override;
 
-   std::error_code readTypeMap(TypeMap& M);
+  std::error_code readTypeMap(TypeMap &M);
+
 public:
   SampleProfileReaderExtBinary(std::unique_ptr<MemoryBuffer> B, LLVMContext &C,
                                SampleProfileFormat Format = SPF_Ext_Binary)
diff --git a/llvm/include/llvm/ProfileData/SampleProfWriter.h b/llvm/include/llvm/ProfileData/SampleProfWriter.h
index fe3121de8..0bbd744c1 100644
--- a/llvm/include/llvm/ProfileData/SampleProfWriter.h
+++ b/llvm/include/llvm/ProfileData/SampleProfWriter.h
@@ -454,7 +454,7 @@ private:
            "Unsupported layout");
   }
 
-  std::error_code writeTypeMap(const TypeMap &Map, raw_ostream& OS);
+  std::error_code writeTypeMap(const TypeMap &Map, raw_ostream &OS);
 
   // TODO:This should be configurable by flag.
   bool WriteVTableProf = false;

``````````

</details>


https://github.com/llvm/llvm-project/pull/141649


More information about the llvm-commits mailing list