[llvm] Added feature in llvm-profdata merge to filter functions from the profile (PR #78378)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 17:57:36 PST 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 a01b58aef0e42fb1b52e358adf4c56678a884d37 c5224825387c9b5e7b2c2bb38ccc56ac19fdb1f6 -- llvm/include/llvm/ProfileData/SampleProf.h llvm/tools/llvm-profdata/llvm-profdata.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index 4c7bf90adb..70b228894a 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -248,8 +248,7 @@ cl::opt<uint64_t> TemporalProfMaxTraceLength(
     cl::desc("The maximum length of a single temporal profile trace "
              "(default: 10000)"));
 cl::opt<std::string> FuncNameNegativeFilter(
-    "no-function", cl::init(""),
-    cl::sub(MergeSubcommand),
+    "no-function", cl::init(""), cl::sub(MergeSubcommand),
     cl::desc("Exclude functions matching the filter from the output."));
 
 cl::opt<FailureMode>
@@ -772,13 +771,11 @@ getFuncName(const StringMap<InstrProfWriter::ProfilingData>::value_type &Val) {
   return Val.first();
 }
 
-static std::string
-getFuncName(const SampleProfileMap::value_type &Val) {
+static std::string getFuncName(const SampleProfileMap::value_type &Val) {
   return Val.second.getContext().toString();
 }
 
-template <typename T>
-static void filterFunctions(T &ProfileMap) {
+template <typename T> static void filterFunctions(T &ProfileMap) {
   bool hasFilter = !FuncNameFilter.empty();
   bool hasNegativeFilter = !FuncNameNegativeFilter.empty();
   if (hasFilter || hasNegativeFilter) {

``````````

</details>


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


More information about the llvm-commits mailing list