From 66092ae0e8dab53aa4c82d74265ae97292b3529f Mon Sep 17 00:00:00 2001 From: Easwaran Raman Date: Fri, 5 May 2017 22:15:09 +0000 Subject: [PATCH] Override invalidate of ProfileSummaryInfo to return false. Differential revision: https://reviews.llvm.org/D32775 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302308 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/ProfileSummaryInfo.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/llvm/Analysis/ProfileSummaryInfo.h b/include/llvm/Analysis/ProfileSummaryInfo.h index 1aec35c3e67..75c4cbd0370 100644 --- a/include/llvm/Analysis/ProfileSummaryInfo.h +++ b/include/llvm/Analysis/ProfileSummaryInfo.h @@ -54,6 +54,18 @@ public: ProfileSummaryInfo(Module &M) : M(M) {} ProfileSummaryInfo(ProfileSummaryInfo &&Arg) : M(Arg.M), Summary(std::move(Arg.Summary)) {} + + /// Handle the invalidation of this information. + /// + /// When used as a result of \c ProfileSummaryAnalysis this method will be + /// called when the module this was computed for changes. Since profile + /// summary is immutable after it is annotated on the module, we return false + /// here. + bool invalidate(Module &, const PreservedAnalyses &, + ModuleAnalysisManager::Invalidator &) { + return false; + } + /// Returns the profile count for \p CallInst. static Optional getProfileCount(const Instruction *CallInst, BlockFrequencyInfo *BFI); -- 2.50.1