[llvm] [Sample Profile] Expand functionality of llvm-profdata function filter (PR #101615)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 11:33:04 PDT 2024


================
@@ -1216,6 +1225,13 @@ class FunctionSamples {
   // all the inline instances and names of call targets.
   void findAllNames(DenseSet<FunctionId> &NameSet) const;
 
+  /// Traverse inlined callsites recursively, and erase those with matching
+  /// canonical representation (or do the opposite, if EraseMatch is false).
+  /// Returns total number of samples removed.
+  uint64_t eraseInlinedCallsites(const llvm::Regex &Re,
+                                 std::string &CanonicalName,
+                                 bool MatchCallTargets, bool EraseMatch);
----------------
WenleiHe wrote:

The API name is about inlined callsites, then we shouldn't do anything about call targets. Optionally removing call targets for this API controlled by a boolean is not a good design. 

Also if the API says "erase", it shouldn't need a boolean `EraseMatch`.

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


More information about the llvm-commits mailing list