[SampleFDO][NFC] Refactor SampleProfile.cpp
authorRong Xu <xur@google.com>
Tue, 16 Feb 2021 18:53:38 +0000 (10:53 -0800)
committerRong Xu <xur@google.com>
Tue, 16 Feb 2021 19:18:21 +0000 (11:18 -0800)
commit310b35304cdf5a230c042904655583c5532d3e91
tree6387363ffa7bd19fdccb6685c1fb29c9346b0e90
parentcddc53ef088b68586094c9841a76b41bee3994a4
[SampleFDO][NFC] Refactor SampleProfile.cpp

Refactor SampleProfile.cpp to use the core code in CodeGen.
The main changes are:
(1) Move SampleProfileLoaderBaseImpl class to a header file.
(2) Split SampleCoverageTracker to a head file and a cpp file.
(3) Move the common codes (common options and callsiteIsHot())
to the common cpp file.

Differential Revision: https://reviews.llvm.org/D96455
llvm/include/llvm/ProfileData/SampleProfileLoaderBaseImpl.h [new file with mode: 0644]
llvm/include/llvm/ProfileData/SampleProfileLoaderBaseUtil.h [new file with mode: 0644]
llvm/lib/ProfileData/CMakeLists.txt
llvm/lib/ProfileData/SampleProfileLoaderBaseUtil.cpp [new file with mode: 0644]
llvm/lib/Transforms/IPO/SampleProfile.cpp