[PATCH] D136627: [SampleFDO] Compute profile mismatch metrics

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 14:51:21 PDT 2022


hoy added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:2106
+    const LineLocation &Loc = I.first;
+    if (Loc.LineOffset & InvalidLineOffsetBit)
+      continue;
----------------
Should invalid line offset also be considered mismatched samples? The samples will discarded any way. 

BTW, sort of having an impression that the invalid line offset checking is used anywhere else. Can we unify the usage if that's the case?


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:2203
+  if (ReportProfileStaleness)
+    MatchingManager->matchProfiles();
+
----------------
nit: rename `matchProfiles` something like `detectProfileMismatch` directly? The name of the switch sounds like only mismatch detection should be done here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136627/new/

https://reviews.llvm.org/D136627



More information about the llvm-commits mailing list