[PATCH] D60903: [SampleFDO] Never set profile entry count to 0

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 09:10:45 PDT 2019


wmi created this revision.
wmi added reviewers: davidxl, eraman.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When profile entry count is 0, it is prone to trigger "div 0" error during profile update in inlining. We have seen a tricky case that expose the error (the testcase is a simplified example to expose it). In the patch, when we need to set the profile entry count to 0, change it to 1. That is aligned with how we handle such case before.


Repository:
  rL LLVM

https://reviews.llvm.org/D60903

Files:
  lib/Transforms/IPO/SampleProfile.cpp
  lib/Transforms/Utils/InlineFunction.cpp
  test/Transforms/SampleProfile/Inputs/accurate-samplepgo.prof
  test/Transforms/SampleProfile/accurate-samplepgo.ll
  test/Transforms/SampleProfile/section-accurate-samplepgo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60903.195878.patch
Type: text/x-patch
Size: 8055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190419/b67c63bc/attachment-0001.bin>


More information about the llvm-commits mailing list