[PATCH] D79920: [llvm][NFC] Simplify ProfileSummaryInfo state transitions.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 15 11:27:07 PDT 2020


davidxl added a comment.

There might be a reason for lazy computation of the summary/thresholds data. +Hiroshi



================
Comment at: llvm/include/llvm/Analysis/ProfileSummaryInfo.h:44
-  bool computeSummary();
-  void computeThresholds();
   // Count thresholds to answer isHotCount and isColdCount queries.
----------------
may be better to keep this helper for readability.


================
Comment at: llvm/lib/Analysis/ProfileSummaryInfo.cpp:97
     Summary.reset(ProfileSummary::getFromMD(SummaryMD));
-    return true;
   }
+  if (!hasProfileSummary()) {
----------------
I think the original early return is clearer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79920





More information about the llvm-commits mailing list