[PATCH] D96455: SampleFDO][NFC] Refactor SampleProfile.cpp

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 14:36:35 PST 2021


xur created this revision.
xur added reviewers: davidxl, wmi, wenlei.
Herald added subscribers: hiraditya, mgorny.
xur requested review of this revision.
Herald added a project: LLVM.

This is a follow-up refactor patch to
https://reviews.llvm.org/D95832
[SampleFDO][NFC] Refactor SampleProfileLoad to reuse the code in CodeGen

The main changes are:
(1) Move SampleProfileLoaderBaseImpl class to a header file.

  include/llvm/ProfileData/SampleProfileLoaderBaseImpl.h.

(2) Split SampleCoverageTracker to a head file:

      include/llvm/ProfileData/SampleProfileLoaderBaseUtil.h,
  and a cpp file:
       lib/ProfileData/SampleProfileLoaderBaseUtil.cpp.

(3) Make the pointer reference to SampleCoverageTracker in the base class.

  This is to break the dependence from SampleProfileLoaderBaseImpl to SampleCoverageTracker.
  All the references will be through the wrapper functions.

(4) Move the common codes (common options and callsiteIsHot()) to

  lib/ProfileData/SampleProfileLoaderBaseUtil.cpp.


https://reviews.llvm.org/D96455

Files:
  llvm/include/llvm/ProfileData/SampleProfileLoaderBaseImpl.h
  llvm/include/llvm/ProfileData/SampleProfileLoaderBaseUtil.h
  llvm/lib/ProfileData/CMakeLists.txt
  llvm/lib/ProfileData/SampleProfileLoaderBaseUtil.cpp
  llvm/lib/Transforms/IPO/SampleProfile.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96455.322829.patch
Type: text/x-patch
Size: 92144 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210210/8ef55dbd/attachment.bin>


More information about the llvm-commits mailing list