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

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 20:50:48 PDT 2024


================
@@ -122,15 +122,153 @@ void SampleProfileMatcher::findProfileAnchors(
   }
 }
 
+MyersDiff::DiffResult
+MyersDiff::longestCommonSequence(const std::vector<Anchor> &A,
+                                 const std::vector<Anchor> &B) const {
+  int32_t N = A.size(), M = B.size(), Max = N + M;
+  auto Index = [&](int32_t I) { return I + Max; };
----------------
WenleiHe wrote:

Does this simple `+Max` need a lambda function?

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


More information about the llvm-commits mailing list