Skip to content

Commit c8b69c9

Browse files
authored
[NFC][SampleFDO] Clean the unneeded field and the related loop (llvm#132376)
Clean the unneeded field 'TotalCollectedSamples' and the unnecessary loop. The field seems introduced in:https://reviews.llvm.org/D31952, and its uses were removed in: https://reviews.llvm.org/D19287, but this field and unnecessary calculation were not cleaned up. This patch will remove these unneeded codes.
1 parent 52d7f14 commit c8b69c9

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

llvm/lib/Transforms/IPO/SampleProfile.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,6 @@ class SampleProfileLoader final : public SampleProfileLoaderBaseImpl<Function> {
562562
/// used to generate the current profile.
563563
std::shared_ptr<ProfileSymbolList> PSL;
564564

565-
/// Total number of samples collected in this profile.
566-
///
567-
/// This is the sum of all the samples collected in all the functions executed
568-
/// at runtime.
569-
uint64_t TotalCollectedSamples = 0;
570-
571565
// Information recorded when we declined to inline a call site
572566
// because we have determined it is too cold is accumulated for
573567
// each callee function. Initially this is just the entry count.
@@ -2183,10 +2177,6 @@ bool SampleProfileLoader::runOnModule(Module &M, ModuleAnalysisManager *AM,
21832177
rejectHighStalenessProfile(M, PSI, Reader->getProfiles()))
21842178
return false;
21852179

2186-
// Compute the total number of samples collected in this profile.
2187-
for (const auto &I : Reader->getProfiles())
2188-
TotalCollectedSamples += I.second.getTotalSamples();
2189-
21902180
auto Remapper = Reader->getRemapper();
21912181
// Populate the symbol map.
21922182
for (const auto &N_F : M.getValueSymbolTable()) {

0 commit comments

Comments
 (0)