[PATCH] D61540: [PGO] Use sum of count values to fix func entry count and add a check to verify BFI counts

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 14:31:36 PDT 2019


xur created this revision.
xur added a reviewer: davidxl.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

Raw profile count values for each BB are not kept after profile annotation. 
We  record function entry count and branch weights and use them to compute the count when needed.
This mechanism works well in a perfect world, but often breaks in real programs, 
because of number prevision, inconsistent profile, or bugs in BFI) .
This patch add functionality to compare BFI counts with real profile counts right after reading the profile.
It also fixes function entry count to make the BFI count close to real profile counts.


https://reviews.llvm.org/D61540

Files:
  llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  llvm/test/Transforms/PGOProfile/Inputs/fix_bfi.proftext
  llvm/test/Transforms/PGOProfile/fix_bfi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61540.198085.patch
Type: text/x-patch
Size: 12022 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190503/17e38d11/attachment.bin>


More information about the llvm-commits mailing list