[SampleFDO] handle ProfileSampleAccurate when initializing function entry count
authorWei Mi <wmi@google.com>
Thu, 13 Dec 2018 21:51:42 +0000 (21:51 +0000)
committerWei Mi <wmi@google.com>
Thu, 13 Dec 2018 21:51:42 +0000 (21:51 +0000)
commit66c6c5abea94e3fcaef169f54b0c91e087ec15dc
treec10fea0e5612aab1501b3ce07614621d82e0c01f
parent7b05666a19c1310d2d3b7e05d08313695b4eaa92
[SampleFDO] handle ProfileSampleAccurate when initializing function entry count

ProfileSampleAccurate is used to indicate the profile has exact match to the
code to be optimized.

Previously ProfileSampleAccurate is handled in ProfileSummaryInfo::isColdCallSite
and ProfileSummaryInfo::isColdBlock. A better solution is to initialize function
entry count to 0 when ProfileSampleAccurate is true, so we don't have to handle
ProfileSampleAccurate in multiple places.

Differential Revision: https://reviews.llvm.org/D55660

llvm-svn: 349088
llvm/lib/Analysis/ProfileSummaryInfo.cpp
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/CodeGenPrepare/section-samplepgo.ll
llvm/test/Transforms/Inline/inline-cold-callsite-samplepgo.ll [deleted file]
llvm/test/Transforms/SampleProfile/inline-cold-callsite-samplepgo.ll [new file with mode: 0644]
llvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll [new file with mode: 0644]