[PATCH] D61609: [llvm] Handle missing debug info when updating sample counts

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 15:12:31 PDT 2019


davidxl added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/InlineFunction.cpp:1472
 
   Callee->setEntryCount(newEntryCount);
+  assert(priorEntryCount > 0 && "Cannot update prof weights when prior entry "
----------------
See line 1468 above -- the priorEntryCount can be zero which will trigger assertion at 1473.   line 1468 can be executed before becaue updateProfileCallee can be invoked in two different contexts:
1) during inline transformation
2) after sample loading for the function.

1) can happen before 2).

In other words, the div by zero can still happen with when debug information is avaiable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61609





More information about the llvm-commits mailing list