[llvm] [llvm-profgen][SPGO] Support profiles with multiple concurrent processes (PR #169353)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 24 08:17:33 PST 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 origin/main HEAD --extensions h,cpp -- llvm/tools/llvm-profgen/PerfReader.cpp llvm/tools/llvm-profgen/PerfReader.h llvm/tools/llvm-profgen/ProfiledBinary.h llvm/tools/llvm-profgen/llvm-profgen.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp
index 1ea3f89f8..a652008b8 100644
--- a/llvm/tools/llvm-profgen/PerfReader.cpp
+++ b/llvm/tools/llvm-profgen/PerfReader.cpp
@@ -1234,7 +1234,7 @@ bool PerfScriptReader::isLBRSample(StringRef Line) {
 
   // Trim off the PID (and maybe part/all of the IP)
   StringRef Trimmed = Line.ltrim().ltrim("0123456789").trim();
-  
+
   // Split by spaces, handling duplicate whitespace using ltrim
   auto Temp = Trimmed.split(' ');
   StringRef FirstPart = Temp.first.ltrim();
@@ -1243,7 +1243,8 @@ bool PerfScriptReader::isLBRSample(StringRef Line) {
   // If we trimmed off the IP, or it's a hybrid profile, there could be a record
   // at the start
   // The 0 at the start of the 0x may have been removed
-  if ((FirstPart.starts_with("x") || FirstPart.starts_with("0x")) && FirstPart.contains('/'))
+  if ((FirstPart.starts_with("x") || FirstPart.starts_with("0x")) &&
+      FirstPart.contains('/'))
     return true;
 
   // Get the next part split by whitespace

``````````

</details>


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


More information about the llvm-commits mailing list