[PATCH] D79417: Don't assert about missing profile info in createProfileWeightsForLoop

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 5 10:14:51 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG55b9b11fea3e: Don't assert about missing profile info in createProfileWeightsForLoop (authored by hans).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79417

Files:
  clang/lib/CodeGen/CodeGenPGO.cpp


Index: clang/lib/CodeGen/CodeGenPGO.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenPGO.cpp
+++ clang/lib/CodeGen/CodeGenPGO.cpp
@@ -1051,8 +1051,7 @@
   if (!PGO.haveRegionCounts())
     return nullptr;
   Optional<uint64_t> CondCount = PGO.getStmtCount(Cond);
-  assert(CondCount.hasValue() && "missing expected loop condition count");
-  if (*CondCount == 0)
+  if (!CondCount || *CondCount == 0)
     return nullptr;
   return createProfileWeights(LoopCount,
                               std::max(*CondCount, LoopCount) - LoopCount);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79417.262151.patch
Type: text/x-patch
Size: 593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200505/15440c1d/attachment.bin>


More information about the cfe-commits mailing list