[llvm] [llvm-profgen] Filter out ambiguous cold profiles during profile generation (PR #81803)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 15:59:23 PST 2024


================
@@ -196,6 +196,39 @@ void ProfileGeneratorBase::showDensitySuggestion(double Density) {
            << "% total samples: " << format("%.1f", Density) << "\n";
 }
 
+// Those functions are usually cold but could have multiple versions, the
+// profile are either from one version or the merged version, which is
+// ambiguous. We can't attribute the profile for each version accurately, so
+// filter them out from the profile map.
+static constexpr const char *FuncPrefixsToFilter[] = {"__cxx_global_var_init",
----------------
WenleiHe wrote:

If `filterAmbiguousProfile` is a member function of `ProfileGeneratorBase`, `FuncPrefixsToFilter` also should be a member (could be static member).

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


More information about the llvm-commits mailing list