[llvm] [SampleFDO] Improve stale profile matching by diff algorithm (PR #87375)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 22:40:39 PDT 2024


================
@@ -328,8 +405,8 @@ void SampleProfileMatcher::recordCallsiteMatchStates(
   // IR callsites.
   for (const auto &I : ProfileAnchors) {
     const auto &Loc = I.first;
-    [[maybe_unused]] const auto &Callees = I.second;
-    assert(!Callees.empty() && "Callees should not be empty");
+    [[maybe_unused]] StringRef CalleeName = I.second.stringRef();
+    assert(!CalleeName.empty() && "Callees should not be empty");
----------------
WenleiHe wrote:

nit: `CalleeName` is only used in assertion, why not fold it into the assertion? 

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


More information about the llvm-commits mailing list