[llvm] [SampleFDO][NFC] Refactoring SampleProfileMatcher (PR #86988)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 11:49:24 PDT 2024


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 6dceea3cb273c8a6ab4c7784980057b3c2793d70 0521286684aed19456d866eb794e5ff017514031 -- llvm/include/llvm/Transforms/IPO/SampleProfileMatcher.h llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h llvm/lib/Transforms/IPO/SampleProfile.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp b/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
index aa0a736483..e76d2f6971 100644
--- a/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
@@ -470,20 +470,19 @@ void SampleProfileMatcher::computeAndReportProfileStaleness() {
   if (ReportProfileStaleness) {
     if (FunctionSamples::ProfileIsProbeBased) {
       errs() << "(" << NumStaleProfileFunc << "/" << TotalProfiledFunc << ")"
-             << " of functions' profile are invalid and "
-             << " (" << MismatchedFunctionSamples << "/" << TotalFunctionSamples
+             << " of functions' profile are invalid and " << " ("
+             << MismatchedFunctionSamples << "/" << TotalFunctionSamples
              << ") of samples are discarded due to function hash mismatch.\n";
     }
     errs() << "(" << (NumMismatchedCallsites + NumRecoveredCallsites) << "/"
            << TotalProfiledCallsites << ")"
-           << " of callsites' profile are invalid and "
-           << "(" << (MismatchedCallsiteSamples + RecoveredCallsiteSamples)
-           << "/" << TotalFunctionSamples << ")"
+           << " of callsites' profile are invalid and " << "("
+           << (MismatchedCallsiteSamples + RecoveredCallsiteSamples) << "/"
+           << TotalFunctionSamples << ")"
            << " of samples are discarded due to callsite location mismatch.\n";
     errs() << "(" << NumRecoveredCallsites << "/"
            << (NumRecoveredCallsites + NumMismatchedCallsites) << ")"
-           << " of callsites and "
-           << "(" << RecoveredCallsiteSamples << "/"
+           << " of callsites and " << "(" << RecoveredCallsiteSamples << "/"
            << (RecoveredCallsiteSamples + MismatchedCallsiteSamples) << ")"
            << " of samples are recovered by stale profile matching.\n";
   }

``````````

</details>


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


More information about the llvm-commits mailing list